EditableJComboBox

I'm using an editable combobox with about 8000 items.
Then it's quite difficult to select the disired item in the list. I'd like the combo box to follow me while typing:
i.e. if i type "M", I want the combobox to display the first item starting wiyh M, but if i type "MI", I want the combo box to display the first item starting with MI and so on.
Is it possible with an editable combobox or should I change component?
Please help me, I'm really in trouble!
Thank you in advance.
Emanuele

if you add a keyListener to the ComboBox and then use that to go to the letter pressed then you can do it like this:    BuySellComboBox.addKeyListener(new java.awt.event.KeyAdapter() {
      public void keyReleased(KeyEvent e) {
        BuySellComboBox_keyPressed(e);
  void BuySellComboBox_keyPressed(KeyEvent e) {
    char typed = e.getKeyChar();
    switch (typed) {
      case ('b'):
     BuySellComboBox.setSelectedIndex(1);
     break;
      case ('s'):
     BuySellComboBox.setSelectedIndex(2);
     break;
      default:
     BuySellComboBox.setSelectedIndex(0);
  }As you can see my combo box only has buy or sell as it's options though, if you want to search on more letters then just add the char from the key pressed to a string and then write a for for loop that searches the ComboBox until it finds :those letters:
int row=0;
String myLetters="mi";
for (int x=0;x<ComboBox.getMaximumRowCount();x++){
   if (ComboBox.getSelectedItem().toString().subString(0,myLetters.length()).equalsIgnoreCase(myLetters)) {
      row=x;
      break;
ComboBox.setSelectedIndex(row);However what if the person types some letters, then changes their mind and types a different letter?
Hope you can do something with this.
If not you may want to use a JList.
regards,
Ben.

Similar Messages

Maybe you are looking for

  • Multiple repositories in 1 bi server ...with PS catalog....in OBIEE 11g

    Any body attempted to do this ? Having multiple repositories in 1 biserver....with multiple webcatalog used in 2 PS on same machine. This doesn't seem to work in OBIEE11g. Analytics.ear contains lots of new deployment descriptors for web.xml in 11g.

  • While posting MIRO price difference account is not determimg for price vari

    Hi Sapients, Please solve the production issue which we have faced yesterday while doing month end closing In one P.O 4 items are there,User has posted entries in below sequence Material type is TRADING GOODS 1)first MIRO with QTY 10 @100$ each,Later

  • KNA1 Mass Maintenance with a BADI implemented.

    Hi Everyone, We have implemented a Customer Master BADI to maintain some additional KNA1 and KNVV fields. when we execute XD99 to mass maintain an SAP field (KNVV-AUFSD)we receive an error "Enter a valid value". When I debug I dsicover that it is att

  • Data management and Data Recovery

    Hi Friends....            Can ne1 help in the folling topics in depth.... 1) Copy a subset of BW data from one cube to another cube in another box 2) Then Deleting the original data 3) Able to reload the archived data 4) Recover the contents lost in

  • How to detect ipaddresses of other systems in a given network Interface ??

    Guys ... I know only the Network Interface and I want to know the IPAddresses that have been assigned to the other systems on that Network Interface .. I m making an application on packet sniffing.. I want to show the list of hosts on a given Network