Solved

JComboBox with a keylistener

Posted on 2004-08-23
11
1,199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
  • +1
11 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
ID: 11869716
0
 
LVL 35

Expert Comment

by:TimYates
ID: 11869720
is a full example with source code :-)
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 11869753
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

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

Expert Comment

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

;-)
0
 

Author Comment

by:cathalmchale
ID: 11870524
Perfect, and answered in 1 reply!!
Thanks
0
 
LVL 35

Expert Comment

by:TimYates
ID: 11870549
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
ID: 24107682
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
ID: 24107733
For 0 points?
0
 
LVL 1

Expert Comment

by:guyneo
ID: 24109588
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
ID: 24110136
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error in @AspectJ Based AOP with Spring 2 23
throw exception 21 68
Java program running SQL query 5 49
Tomcat 9 + java 8 error while trying to deploy a war file 2 723
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

733 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