File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JList or JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JList or JTable" Watch "JList or JTable" New topic
Author

JList or JTable

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

In my application I currently have a JList with a list of names. I want to be able to edit/add the names. So I have 2 options that I know of:
1. Use a JButton and when clicked prompt user for a new name. Use a JButton for edit, and prompt the user to edit the selected name in the List.
2. Use a single column JTable and edit/add the names directly.
Now for my question. Is there a way to edit an item in a JList in the same manner you can edit data in a JTable, direclty in the containing Cell?
If not, I will probably end up using a JTable. But am just curious about the latter.
Thanks.
[ June 21, 2002: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
there is an example of an editable list:
http://www2.gol.com/users/tame/swing/examples/JTableExamples3.html
cheers
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Thanks for the reply. However, I don't believe that is an Editable JList. I believe that is a 1 column JTable that is actually editable. The JList on the left is updated by the JTable.
But thanks anyway.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JList or JTable
 
Similar Threads
jtable
JTable
Clone JTable
Jtable and Scrollbar
JTable