Refine search
(JTextComponent) listEditor.getEditor().getEditorComponent();
public JTextComponent getTextComponent() { // returning the component of the combobox's editor return (JTextComponent) comboBox.getEditor().getEditorComponent(); } }
@Override public JTextComponent getTextComponent() { // returning the component of the combobox's editor return (JTextComponent) comboBox.getEditor().getEditorComponent(); } }
JComboBox comboBox = new JComboBox( ... ); comboBox.setEditable( true ); ComboBoxEditor editor = comboBox.getEditor(); JTextField textField = (JTextField)editor.getEditorComponent(); textField.setColumns(3);
private void handleEnabled(PropertyChangeEvent evt) { if (Boolean.TRUE.equals(evt.getNewValue())) { comboBox.setEditable(true); } else { JTextComponent textComponent = (JTextComponent) comboBox.getEditor().getEditorComponent(); boolean strictMatching = ((AutoCompleteDocument) textComponent.getDocument()).strictMatching; comboBox.setEditable(!strictMatching); } }
private void addListeners() { className.getDocument().addDocumentListener(updateListener); displayName.getDocument().addDocumentListener(updateListener); Component editorComp = packageName.getEditor().getEditorComponent(); if (editorComp instanceof JTextComponent) { ((JTextComponent) editorComp).getDocument().addDocumentListener(updateListener); } }
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("editor")) { ComboBoxEditor editor = comboBox.getEditor(); if (editor!=null && editor.getEditorComponent()!=null) { JComponent editorComponent = (JComponent) comboBox.getEditor().getEditorComponent(); editorComponent.addKeyListener(this); editorComponent.setBorder(null); } } } }
@Override public JTextComponent getTextComponent(JComboBox t) { if (t.isEditable()) { Component editorComp = t.getEditor() .getEditorComponent(); if (editorComp instanceof JTextComponent) { return (JTextComponent) editorComp; } } return null; } });
VSPMDListener(JComboBox box) { box.addItemListener(this); box.getEditor().getEditorComponent().addKeyListener(this); // this line makes it possible to receive events when user types in a combo box } public void itemStateChanged(ItemEvent event)
private void unregisterKeyboardActions() { ((JTextField) _comboBox.getEditor().getEditorComponent()).unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)); ((JTextField) _comboBox.getEditor().getEditorComponent()).unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)); ((JTextField) _comboBox.getEditor().getEditorComponent()).unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)); ((JTextField) _comboBox.getEditor().getEditorComponent()).unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)); }
@Override public JTextComponent getTextComponent(JComboBox t) { if (t.isEditable()) { Component editorComp = t.getEditor() .getEditorComponent(); if (editorComp instanceof JTextComponent) { return (JTextComponent) editorComp; } } return null; } });
@Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { if (comboBoxPathChooser.getSelectedIndex() != -1 && !((JTextComponent) (comboBoxPathChooser). getEditor().getEditorComponent()).getText().isEmpty()) { enterPressed(table); } }
public void setText(String aValue) { if (isEditable()) { ((JTextComponent) super.getEditor().getEditorComponent()).setText(aValue); } } }
private void classFieldChanged() { try { final JTextComponent tc = (JTextComponent) classField.getEditor().getEditorComponent(); selectedClass = PromiscuousClassUtilsA.forName(tc.getText()); } catch (Exception err) { selectedClass = null; } classBrowserButton.setEnabled(selectedClass != null || true); }
private void registerKeyboardActions(AbstractAction closeAction, AbstractAction findNextAction, AbstractAction findPrevAction) { ((JTextField) _comboBox.getEditor().getEditorComponent()).registerKeyboardAction(findNextAction, KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), JComponent.WHEN_FOCUSED); ((JTextField) _comboBox.getEditor().getEditorComponent()).registerKeyboardAction(findNextAction, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), JComponent.WHEN_FOCUSED); ((JTextField) _comboBox.getEditor().getEditorComponent()).registerKeyboardAction(findPrevAction, KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), JComponent.WHEN_FOCUSED); ((JTextField) _comboBox.getEditor().getEditorComponent()).registerKeyboardAction(closeAction, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_FOCUSED); }
public SiteZipPanel(SiteZip.Customizer cust) { this.cust = cust; initComponents(); List<String> templates = new ArrayList<String>(SiteZip.getUsedTemplates()); if (templates.size() > 0 && templates.get(0).length() > 0) { templates.add(0, ""); //NOI18N } archiveComboBox.setModel(new DefaultComboBoxModel(templates.toArray(new String[templates.size()]))); ((JTextField)(archiveComboBox.getEditor().getEditorComponent())).getDocument().addDocumentListener(this); }
@Override public void installUI(JComponent c) { super.installUI(c); comboBox.setRequestFocusEnabled(true); if (comboBox.getEditor() != null) { if (comboBox.getEditor().getEditorComponent() instanceof JTextField) { ((JTextField) (comboBox.getEditor().getEditorComponent())).setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 1)); } } }
public void installUI(JComponent c) { super.installUI(c); comboBox.setRequestFocusEnabled(true); if (comboBox.getEditor() != null) { if (comboBox.getEditor().getEditorComponent() instanceof JTextField) { ((JTextField) (comboBox.getEditor().getEditorComponent())).setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); } } }
private void initComponents2() { fxmlNameTextField.getDocument().addDocumentListener(this); packageComboBox.getEditor().addActionListener(this); Component packageEditor = packageComboBox.getEditor().getEditorComponent(); if (packageEditor instanceof JTextField) { ((JTextField) packageEditor).getDocument().addDocumentListener(this); } locationComboBox.setRenderer(new SourceGroupSupport.GroupListCellRenderer()); packageComboBox.setRenderer(PackageView.listRenderer()); locationComboBox.addActionListener(this); }
private void initComponents2() { textFieldClassName.getDocument().addDocumentListener(this); comboBoxPackage.getEditor().addActionListener(this); Component packageEditor = comboBoxPackage.getEditor().getEditorComponent(); if (packageEditor instanceof JTextField) { ((JTextField) packageEditor).getDocument().addDocumentListener(this); } comboBoxSourceRoot.setRenderer(new SourceGroupSupport.GroupListCellRenderer()); comboBoxPackage.setRenderer(PackageView.listRenderer()); comboBoxSourceRoot.addActionListener(this); }