public GenericEditorWithClass(Class cls) { super(new JTextField()); getComponent().setName("Table.editor"); try { constructor = cls.getConstructor(argTypes); } catch (Exception e) { e.printStackTrace(); } }
for (TextAreaDestination textDest : TextAreaDestination.values()) { JTextArea tArea = new JTextArea(TA_ROWS, TA_COLS); tArea.setName(textDest.getText()); tArea.setWrapStyleWord(true); tArea.setLineWrap(true);
private void setName(final Component comp, String name) { comp.setName(name); }
import javax.swing.JFrame; import javax.swing.JPanel; public class Main extends JFrame { public Main() { add(new JPanel()); setName("NGame"); setDefaultCloseOperation(EXIT_ON_CLOSE); } }
public GenericCellEditor( final Class fallbackType, final boolean allowEmptyString ) { super( new JTextField() ); this.fallbackType = fallbackType; this.allowEmptyString = allowEmptyString; getComponent().setName( "Table.editor" ); }
public GenericEditor(JTextField textField) { super(textField); getComponent().setName("Table.editor"); }
public GenericEditor(JTextField textField) { super(textField); getComponent().setName("Table.editor"); }
public GenericEditor(JTextField textField) { super(textField); getComponent().setName("Table.editor"); }
public GenericEditor(JTextField textField) { super(textField); getComponent().setName("Table.editor"); }
public GenericEditor(JTextField textField) { super(textField); getComponent().setName("Table.editor"); }
/** * Updates the name of the bean using the value entered in the name field */ private void updateBeanName(JETABean bean) { if (bean != null) { Component comp = bean.getDelegate(); if (comp != null) { String bname = FormDesignerUtils.fastTrim(m_name_field.getText()); if (!bname.equals(comp.getName())) comp.setName(bname); } } }
protected Component createPreviousButton() { Component c = createArrowButton( SwingConstants.SOUTH); c.setName( "Spinner.previousButton"); installPreviousButtonListeners(c); return c; }
protected Component createNextButton() { Component c = createArrowButton( SwingConstants.NORTH); c.setName( "Spinner.nextButton"); installNextButtonListeners(c); return c; }
@Override public void setName(String name) { log.checkName(this, name); this.name = name; component.setName(name); log.nameSet(this, name); }
private void editComponentName(GridComponent gc) { Component comp = gc.getBeanDelegate(); if (comp != null) { String oldname = comp.getName(); String newvalue = javax.swing.JOptionPane.showInputDialog(comp, I18N.getLocalizedMessage("Set Name"), oldname); if (newvalue != null) { comp.setName(newvalue); gc.fireGridCellEvent(new GridCellEvent(GridCellEvent.EDIT_COMPONENT, gc, GridCellEvent.COMPONENT_NAME_CHANGED)); } } }
/** Builds the panel GUI components and sets up connections between the components by using listeners. **/ private void setupPane() { // Text Area sql_ = new SQLQueryClause(20); sql_.setName("summaryClause"); sql_.setEditable(false); setLayout(new BorderLayout()); add("Center", new LabelledComponent("DBQUERY_LABEL_SQL", new ScrollingTextPane(sql_))); }
protected Component getWrapperForComponent(Dockable dockable, Component component, Action action) { if (isWrapRequest(dockable, action)) { return forceWrapperForComponent(dockable, component); } else { Component wrapper = new DockablePanel(dockable, component); wrapper.setName("@@mydoggy.dockable.panel"); return wrapper; } }
public void actionPerformed(ActionEvent evt) { GridComponent gc = getCurrentEditor().getSelectedComponent(); if (gc != null) { java.awt.Component comp = gc.getBeanDelegate(); if (comp != null) { String oldname = comp.getName(); String newvalue = javax.swing.JOptionPane.showInputDialog(m_frame, I18N.getLocalizedMessage("Set Name"), oldname); if (newvalue != null) { comp.setName(newvalue); gc.fireGridCellEvent(new GridCellEvent(GridCellEvent.EDIT_COMPONENT, gc, GridCellEvent.COMPONENT_NAME_CHANGED)); } } } } }
Component component = new Component(); component.setName("My component"); component.getServers().add(Protocol.HTTP, 8182); MyApplication application = new MyApplication(); // To attach application on /www.example.com component.getDefaultHost().attach("www.example.com", application); // To attach application on / component.getDefaultHost().attachDefault(application); component.start();