implements JComboBox.KeySelectionManager : JComboBox « javax.swing « Java by API






implements JComboBox.KeySelectionManager

  

import javax.swing.ComboBoxModel;
import javax.swing.JComboBox;

public class Main {
  public static void main(String[] argv) throws Exception {
    String[] items = { "A", "A", "B", "B", "C", "C" };
    JComboBox cb = new JComboBox(items);
    cb.setKeySelectionManager(new MyKeySelectionManager());
  }
}

class MyKeySelectionManager implements JComboBox.KeySelectionManager {
  long lastKeyTime = 0;
  String pattern = "";

  public int selectionForKey(char aKey, ComboBoxModel model) {
    return 1;
  }
}

   
    
  








Related examples in the same category

1.new JComboBox()
2.new JComboBox(ComboBoxModel aModel)
3.new JComboBox(Vector items)
4.JComboBox: addActionListener(ActionListener lis)
5.JComboBox: addItem(Object o)
6.JComboBox: addItemListener(ItemListener lis)
7.JComboBox: addPopupMenuListener(PopupMenuListener l)
8.JComboBox: getActionMap()
9.JComboBox: getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
10.JComboBox: getItemAt(int index)
11.JComboBox: getItemCount()
12.JComboBox: getKeySelectionManager()
13.JComboBox: getSelectedIndex()
14.JComboBox: getSelectedItem()
15.JComboBox: insertItemAt(Object anObject, int index)
16.JComboBox: isPopupVisible()
17.JComboBox: removeAllItems()
18.JComboBox: removeItemAt(int anIndex)
19.JComboBox: setEditor(ComboBoxEditor anEditor)
20.JComboBox: setKeySelectionManager(KeySelectionManager aManager)
21.JComboBox: setRenderer(ListCellRenderer aRenderer)
22.JComboBox: setEditable(boolean b)
23.JComboBox: setMaximumRowCount(int count)
24.JComboBox: setSelectedIndex(int anIndex)
25.JComboBox: setSelectedItem(Object anObject)
26.JComboBox: setUI(ComboBoxUI ui)