Results 1 to 4 of 4
Thread: How to use a JList?
- 03-23-2009, 11:52 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 20
- Rep Power
- 0
How to use a JList?
I have books that don't mention it, sample code that doesn't compile, and more sample code that does fancy tricks but not illustrate the basics.
Maybe I'm dumb, but the one thing I can't seem to figure out is how to just double click on something in a JList and make it do something. I have a list that is created and added to a window in response to user input, and I can't get anything out of it.
Can anyone provide beginning-to-end sample code to do that, or point to a good tutorial? I would appreciate it.
- 03-24-2009, 02:08 AM #2
Member
- Join Date
- Mar 2009
- Posts
- 6
- Rep Power
- 0
Did you look it up in the documentation?
Last edited by Poincare; 03-24-2009 at 02:11 AM.
- 03-24-2009, 02:58 AM #3
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
getSelectedIndex()
Returns the smallest selected cell index; the selection when only a single item is selected in the list.
add mouselistener to detect double click
- 03-24-2009, 10:27 AM #4
Similar Threads
-
JList and JPanels
By JetsYanks in forum New To JavaReplies: 8Last Post: 12-25-2009, 02:11 PM -
JList issues
By aneesahamedaa in forum AWT / SwingReplies: 7Last Post: 12-15-2009, 04:16 PM -
JList
By pinks_70986 in forum New To JavaReplies: 1Last Post: 02-12-2009, 08:36 AM -
About JList
By hungleon88 in forum Advanced JavaReplies: 5Last Post: 08-30-2008, 09:24 PM -
Help with JList
By Albert in forum NetBeansReplies: 1Last Post: 07-13-2007, 03:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks