List of utility methods to do JTextField Auto Complete
void | installAutoComplete(final JTextField textField, final List install Auto Complete final JList jList = new JList(); jList.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { System.out.println("select"); }); final DefaultListModel model = new DefaultListModel(); ... |
void | setupAutoComplete(final JTextField textField, final List setup Auto Complete final DefaultComboBoxModel model = new DefaultComboBoxModel(items.toArray()); final JComboBox combo = new JComboBox(model) { private static final long serialVersionUID = 1L; public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, 0); }; combo.putClientProperty(Integer.toHexString(combo.hashCode()) + "@is_adjusting", false); ... |