Solved

Editable JList

Posted on 2001-08-08
6
1,326 Views
Last Modified: 2012-08-13
I have an applet that has a panel that is made up a JList. This list is all populated with a data vector. Now, I would like to be able to edit the elements directly inside the JList. So maybe if I double clicked on an element in the list than a cursor would appear and then I could up date that particular list. Thus containing all editing of the JList within itself. I know I could use a combination of components to to so but what I invision is a PopUp menu that comes up on the JList that enable me to ADD,UPDATE,DELETE from the already populated JList for proper saving later on to a database.
0
Comment
Question by:thenopsis
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6366362
JList does not support what you want to do.

The easiest way to do handle this would be to instead use a single column JTable which can be made to look just like a JList.
0
 

Author Comment

by:thenopsis
ID: 6379819
Thanks for nothing.....Please do not propose an answer or comment with nothing in it at all. If you can help me out that would be greatly appreciated but please don't continue adding blank comments and/or answers.
0
 

Author Comment

by:thenopsis
ID: 6380544
objects,

Thanks for the input, I have tried what you suggested and for the most part I will be able to have the functionality that I require but do you know how to change whether or not a cell is editable in the JTable after the table has been created and placed on a panel to be viewed. I know that you can overwrite isCellEditable() from DefaultTableModel to specify which cells are editable at the time the JTable is constructed but after this point I can't figure out a way to make editable and of the cells previously set to non-editable.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 92

Accepted Solution

by:
objects earned 40 total points
ID: 6382361
You need to override isCellEditable and implement whatever editable policy you require.
0
 

Expert Comment

by:CleanupPing
ID: 9061906
thenopsis:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 20

Expert Comment

by:Venabili
ID: 9329880
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points for objects

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venabili
EE Cleanup Volunteer
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 96
JUnit 4 @Before and @BeforeClass differences 3 59
by zero exception 10 39
mysql jsp example issue 32 32
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now