How to make choices visible in a JComboBox?

A

Aaron Fude

Hi,

I'm writing a JComboBox with a custom Editor. The idea is that when
the user inputs a string, the choices are narrowed down to match the
input.

When the user starts typing, how does one reveal the available
choices? In other words, how does one make the choices open up as if
the little "arrow down" next to the combo box is pressed?

Many thanks in advance,

Aaron
 
R

Rob Dennis

Aaron said:
Hi,

I'm writing a JComboBox with a custom Editor. The idea is that when
the user inputs a string, the choices are narrowed down to match the
input.

When the user starts typing, how does one reveal the available
choices? In other words, how does one make the choices open up as if
the little "arrow down" next to the combo box is pressed?

Have you taken a look at Glazed Lists
(http://publicobject.com/glazedlists/)? Maybe they already do what you
are trying to build.
 
R

Roedy Green

When the user starts typing, how does one reveal the available
choices?

Another possible route is to use a JList which always displays all the
choices.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top