Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Can't Make Swing JList look like AWT Choice

Reply
Thread Tools

Can't Make Swing JList look like AWT Choice

 
 
Don Sykes
Guest
Posts: n/a
 
      02-25-2004

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)

 
Reply With Quote
 
 
 
 
xarax
Guest
Posts: n/a
 
      02-25-2004
"Don Sykes" <(E-Mail Removed)> wrote in message
news:sI5%b.2576$(E-Mail Removed) m...
>
> 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?


 
Reply With Quote
 
 
 
 
Don Sykes
Guest
Posts: n/a
 
      02-25-2004
xarax wrote:

> "Don Sykes" <(E-Mail Removed)> wrote in message
> news:sI5%b.2576$(E-Mail Removed) m...
>
>>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?
>
>

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)

 
Reply With Quote
 
Christophe Vanfleteren
Guest
Posts: n/a
 
      02-25-2004
Don Sykes wrote:

> xarax wrote:
>
>> "Don Sykes" <(E-Mail Removed)> wrote in message
>> news:sI5%b.2576$(E-Mail Removed) m...
>>
>>>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?
>>
>>

> Thanks.
> Silly me. The name JComboBox threw me off. I thought it was used to
> create dialog boxes with buttons!
>


You might want to check this out:

http://java.sun.com/docs/books/tutor...omponents.html

--
Kind regards,
Christophe Vanfleteren
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A swing/awt component that looks like a LED =?iso-8859-1?q?J=FCrgen_Gerstacker?= Java 2 12-17-2006 09:26 AM
swing jlist, how to print out once instread of twice when selection changed John_Woo Java 3 10-03-2006 07:02 AM
Swing Model Classes Updating Swing Components on a Thread Other Than AWT mkrause Java 0 05-06-2005 04:32 PM
Can Choice components respond to keyboard input like HTML Choice components? Mickey Segal Java 0 02-02-2004 10:59 PM
JMF install on Linux: Cannot load AWT toolkit: gnu.java.awt.peer.gtk. Robert Mark Bram Java 2 12-11-2003 06:57 AM



Advertisments