Can't Make Swing JList look like AWT Choice

D

Don Sykes

I've converted most of my apps to Swing from AWT, but I can't seem to
get a JList in a JScrollPane to behave like Choice does: i.e. show just
one option at a time for selection. It always fills up the JPanel, in my
case, displaying 4 or more options at a time.
I've tried things like setVisibleRowCount(1) and setting the size of the
JScrollPane explicitly, but no luck. Any suggestions??

TIA
--

Have Java, Will Travel
Wire paladin, San Francisco

(paladinATalphaseDOTcom)
 
X

xarax

Don Sykes said:
I've converted most of my apps to Swing from AWT, but I can't seem to
get a JList in a JScrollPane to behave like Choice does: i.e. show just
one option at a time for selection. It always fills up the JPanel, in my
case, displaying 4 or more options at a time.
I've tried things like setVisibleRowCount(1) and setting the size of the
JScrollPane explicitly, but no luck. Any suggestions??

TIA
--

Uh, maybe you want a JComboBox?
 
D

Don Sykes

xarax said:
Uh, maybe you want a JComboBox?
Thanks.
Silly me. The name JComboBox threw me off. I thought it was used to
create dialog boxes with buttons!

--

Have Java, Will Travel
Wire paladin, San Francisco

(paladinATalphaseDOTcom)
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top