Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2004

Tip: Looking for answers? Try searching our database.

JList as a JMenuItem?

Thread view: 
Jim Crowell - 04 Feb 2004 21:31 GMT
Hi,

I am designing a Popup Menu Item that shall allow the End User to select an
item from an indeterminate length List.

I know how to add each JList element to the JPopupMenu but because the
length of the list is variable I need to implement a Scroll Bar somehow.

Ideally, I would like to add a JList hosted by a JScrollPane to my
JPopupMenu instance.

I found some code on the net that suggest that I build an Inner Class that
extends JList and uses the 'MenuElement' Interface. Actually the sample I
saw extended the JSlider Class.

I got that code past the compiler but the JList shows up funny and I was not
able to assign an Action Event.

Question:

I guess I could just make a new JDialog to contain my JList and place it
over the JPopupMenu but I am wondering if there is a way to implement a
JList as an item in my JPopupMenu instance?

NOTE: JSPinner would be nice in lieu of JList but I am still at Java 1.3.1
and I believe JSpinner is a 1.4.1 Class...

Many thanks,

Jim.
Jim Crowell - 06 Feb 2004 17:15 GMT
Follow Up FYI:

I got a litttle further with the usage of a JList in a Menu Item so I think
it is most likely possible.

However, I implemented my requirement by using JMenuItem's for each List
item and managing
"UP" / "DOWN" Menu Items to scroll the variable length items list.

Regards,
Jim...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.