?
Solved

JComboBox with a keylistener

Posted on 2004-08-23
11
Medium Priority
?
1,216 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 200 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 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