[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Editable JList

Posted on 2001-08-08
6
Medium Priority
?
1,387 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 92

Accepted Solution

by:
objects earned 160 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
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:
Suggested Courses

650 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