Solved

JComboBox with a keylistener

Posted on 2004-08-23
11
1,190 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
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 89
ArrayIndexOutOfBoundException 9 80
Why my table column Id is not passed to java object? 4 38
Java exception bubble up 2 17
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

813 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

10 Experts available now in Live!

Get 1:1 Help Now