Solved

JComboBox with a keylistener

Posted on 2004-08-23
11
1,180 Views
Last Modified: 2006-11-17
How r ya?

I have a JComboBox with a long list of (sorted) variable names. Because of the length of the list the user should be able to approx. jump to the variable by entering the first couple of letters??  I know we see examples of this everyday in computer apps, but how do i do this in Java??
 Is it much more difficult to implement "the first few letter" than "the first letter" ??
0
Comment
Question by:cathalmchale
  • 6
  • 2
  • 2
  • +1
11 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
Comment Utility
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
is a full example with source code :-)
0
 
LVL 15

Expert Comment

by:ozymandias
Comment Utility
You probably need to subclass JComboBox and add a keystroke listener that captures the keystrokes and concaten\ates them into a string and filters/selects the combobox contents accordingly.
0
 
LVL 15

Expert Comment

by:ozymandias
Comment Utility
...or find someone who's already done it....:)
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
That link I gave is a very clean implementation of it all..based on PlainDocument in an editable JComboBox :-)

;-)
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:cathalmchale
Comment Utility
Perfect, and answered in 1 reply!!
Thanks
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
I saw it the other day on JavaLobby, so it was stuck in my head as being quite cool :-)

Good luck with it!!

Tim
0
 
LVL 1

Expert Comment

by:guyneo
Comment Utility
I am also looking for exactly this.  However the link http://www.orbital-computer.de/JComboBox/ is broken.
Can you guys please give me the link to this on java lobby site or post the code?
thanks
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
For 0 points?
0
 
LVL 1

Expert Comment

by:guyneo
Comment Utility
sorry. I am new to this site. How can I give points on this question that has been accepted?  Is there a way? Or should I post this as a new question? how will it come to your attention when I post this as a new question?
please let me know.
thanks
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
Sorry...was grumpy this morning

For future reference, you can "Ask related question" (above the comment entry box) and the original people get notified

The best I can come up with, with that site being down is:

http://www.google.co.uk/search?hl=en&q=http%3A%2F%2Fwww.orbital-computer.de%2FJComboBox%2F&btnG=Google+Search&meta=&aq=f&oq=

Ignore the first result, but the others seem to be copies of the original code
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now