javax.swing.JComponent.setName()方法的使用及代码示例

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

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

JComponent.setName介绍

暂无

代码示例

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/**
 * Lazily creates a radio button renderer
 */    
private RadioRenderer radioRenderer() {
  if (radioRenderer == null) {
    radioRenderer = new RadioRenderer(tableUI);
    //Mainly for debugging
    ((JComponent) radioRenderer).setName("RadioRenderer for " + 
      getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N
  }
  return radioRenderer;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/**
 * Lazily creates a string renderer
 */    
private StringRenderer stringRenderer() {
  if (stringRenderer == null) {
    stringRenderer = new StringRenderer(tableUI);
    //Mainly for debugging
    ((JComponent) stringRenderer).setName("StringRenderer for " + 
      getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N
  }
  return stringRenderer;
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/**
 * Lazily creates a combo box renderer
 */
private ComboboxRenderer comboboxRenderer() {
  if (comboboxRenderer == null) {
    comboboxRenderer = new ComboboxRenderer(tableUI);
    //Mainly for debugging
    ((JComponent) comboboxRenderer).setName(
      "ComboboxRenderer for " + getClass().getName() + "@" + System.identityHashCode(this)
    ); //NOI18N
  }
  return comboboxRenderer;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/**
 * Lazily creates a string renderer
 */    
private StringRenderer stringRenderer() {
  if (stringRenderer == null) {
    stringRenderer = new StringRenderer(tableUI);
    //Mainly for debugging
    ((JComponent) stringRenderer).setName("StringRenderer for " + 
      getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N
  }
  return stringRenderer;
}

代码示例来源:origin: bcdev/beam

/**
 * Used to uniquely name components for UI testing. Format of the new name is  "id.suffix".
 * @param component the component to be named
 * @param suffix the name suffix
 */
protected void nameComponent(JComponent component, String suffix) {
  component.setName(getComponentName(suffix));
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/**
 * Lazily creates a radio button renderer
 */
private RadioRenderer radioRenderer() {
  if (radioRenderer == null) {
    radioRenderer = new RadioRenderer(tableUI);
    //Mainly for debugging
    ((JComponent) radioRenderer).setName(
      "RadioRenderer for " + getClass().getName() + "@" + System.identityHashCode(this)
    ); //NOI18N
  }
  return radioRenderer;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/**
 * Lazily creates a checkbox renderer
 */    
private CheckboxRenderer checkboxRenderer() {
  if (checkboxRenderer == null) {
    checkboxRenderer = new CheckboxRenderer();
    //Mainly for debugging
    ((JComponent) checkboxRenderer).setName("CheckboxRenderer for " + 
      getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N
  }
  return checkboxRenderer;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/**
 * Lazily creates a combo box renderer
 */    
private ComboboxRenderer comboboxRenderer() {
  if (comboboxRenderer == null) {
    comboboxRenderer = new ComboboxRenderer(tableUI);
    //Mainly for debugging
    ((JComponent) comboboxRenderer).setName("ComboboxRenderer for " + 
      getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N
  }
  return comboboxRenderer;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/**
 * Lazily creates a checkbox renderer
 */    
private CheckboxRenderer checkboxRenderer() {
  if (checkboxRenderer == null) {
    checkboxRenderer = new CheckboxRenderer();
    //Mainly for debugging
    ((JComponent) checkboxRenderer).setName("CheckboxRenderer for " + 
      getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N
  }
  return checkboxRenderer;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/**Lazily create (or create a new instance of) the string editor */
private InplaceEditor getStringEditor(boolean newInstance) {
  if (newInstance) return new StringInplaceEditor();
  if (text == null) {
    text = new StringInplaceEditor();
    //Mainly for debugging
    ((JComponent) text).setName("StringEditor for " + 
      getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N
  }
  return text;
}

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-corefields

@Override
public void setName(String name) {
  super.setName(format("%s-%s", name, FILE_FIELD_PANEL_NAME));
  this.name = name;
  fileField.setName(format("%s-%s", name, FILE_FIELD_NAME));
  openFileChooser.setName(format("%s-%s", name, OPEN_FILE_CHOOSER_NAME));
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/**Lazily create (or create a new instance of) the string editor */
private InplaceEditor getStringEditor(boolean newInstance) {
  if (newInstance) return new StringInplaceEditor();
  if (text == null) {
    text = new StringInplaceEditor();
    //Mainly for debugging
    ((JComponent) text).setName("StringEditor for " + 
      getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N
  }
  return text;
}

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-corefields

public void setFileField(JComponent field) {
  field.setName(format("%s-%s", name, FILE_FIELD_NAME));
  remove(fileField);
  add(field, "cell 0 0,growx");
  this.fileField = field;
}

代码示例来源:origin: cmu-phil/tetrad

/**
 * Sets the name of the node.
 */
public final void setName(String name) {
  if (name == null) {
    throw new NullPointerException("Name must not be null.");
  }
  super.setName(name);
  if (displayComp != null) {
    displayComp.setName(name);
  }
  repaint();
}

代码示例来源:origin: cmu-phil/tetrad

public void setName(String name) {
  super.setName(name);
  setSize(getPreferredSize());
}

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-corefields

/**
 * Create the panel.
 */
UiPanel() {
  setLayout(new MigLayout("", "0[grow][]0", "0[]0"));
  fileField = new JTextField();
  fileField.setName(FileChooserField.FILE_FIELD_NAME);
  add(fileField, "cell 0 0,growx");
  openFileChooser = new JButton("...");
  openFileChooser.setName(OPEN_FILE_CHOOSER_NAME);
  add(openFileChooser, "cell 1 0");
}

代码示例来源:origin: bcdev/beam

protected void nameComponent(JComponent component, String suffix) {
    if (component != null && component.getName() == null) {
      component.setName(getParameter().getName() + "." + suffix);
    }
  }
}

代码示例来源:origin: Multibit-Legacy/multibit-hd

/**
 * <p>Basic FEST and Accessibility support (no tooltip or description)</p>
 *
 * @param component The Swing component to decorate
 * @param nameKey   The component name (used directly for FEST and with lookup for accessible name)
 * @param values    The values to apply to the accessible name
 */
public static void apply(JComponent component, MessageKey nameKey, Object... values) {
 // Ensure FEST can find it
 component.setName(nameKey.getKey());
 // Ensure Accessibility API can find it
 component.getAccessibleContext().setAccessibleName(Languages.safeText(nameKey, values));
}

代码示例来源:origin: com.github.danielpacak.osgi.swingconsole/osgi.swingconsole

public AttributeFormField(AttributeValueConversionService conversionService, AttributeDTO attribute) {
  this.conversionService = checkArgumentNotNull(conversionService, "ConversionService cannot be null");
  this.attribute = checkArgumentNotNull(attribute, "Attribute cannot be null");
  editor = newEditor(attribute);
  label = new JLabel(attribute.getName() + " (" + attribute.getId() + ")", JLabel.TRAILING);
  label.setToolTipText(attribute.getDescription());
  label.setLabelFor(editor);
  label.setName("label.attribute." + attribute.getId());
  editor.setName("editor.attribute." + attribute.getId());
}

代码示例来源:origin: freeplane/freeplane

@Override
public void setName(final String title) {
  changeToThisMap(getMapViewManager());
  Controller.getCurrentController().getMapViewManager().getMapViewComponent().setName(title);
}

相关文章

JComponent类方法