javax.swing.text.JTextComponent.getName()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中javax.swing.text.JTextComponent.getName()方法的一些代码示例,展示了JTextComponent.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.getName()方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:getName

JTextComponent.getName介绍

暂无

代码示例

代码示例来源:origin: com.l2fprod.common/l2fprod-common-shared

void store() {
  Preferences prefs = node().node("JTextComponent");
  prefs.put(text.getName(), text.getText());
 }
};

代码示例来源:origin: com.l2fprod.common/l2fprod-common-shared

void restore() {      
 Preferences prefs = node().node("JTextComponent");
 text.setText(prefs.get(text.getName(), ""));      
}
void store() {

代码示例来源:origin: net.sf.cuf/cuf-swing

/**
 * Creates a new state, using the handed text field as its state source.
 * If the content  of the text field matches pContent, then the state is
 * true
 * @param pTextField text field we take the document from
 * @param pContent string to compare to
 */
public SwingDocumentState(final JTextComponent pTextField, final String pContent)
{
  super();
  if (pTextField==null)
  {
    throw new IllegalArgumentException("textfield must not be null");
  }
  if (pContent==null)
  {
    throw new IllegalArgumentException("compare content must not be null");
  }
  mContent= pContent;
  // initially set the state according to the document
  mDocument= pTextField.getDocument();
  mIsEnabled   = getInternalState();
  mName    = pTextField.getName();
  if (mName==null)
  {
    mName= "";
  }
  mDocument.addDocumentListener(this);
}

代码示例来源:origin: joel-costigliola/assertj-swing

/**
 * <p>
 * Indicates whether the text of the given {@code JTextComponent} is equal to the text in this matcher.
 * </p>
 *
 * <p>
 * <b>Note:</b> This method is accessed in the current executing thread. Such thread may or may not be the event
 * dispatch thread (EDT). Client code must call this method from the EDT.
 * </p>
 *
 * @param textComponent the {@code JTextComponent} to match.
 * @return {@code true} if the text in the {@code JTextComponent} is equal to the text in this matcher, {@code false}
 *         otherwise.
 */
@RunsInCurrentThread
@Override
protected boolean isMatching(@Nonnull JTextComponent textComponent) {
 return isNameMatching(textComponent.getName()) && arePropertyValuesMatching(text, textComponent.getText());
}

相关文章

JTextComponent类方法