Solved

Editable JList

Posted on 2001-08-08
6
1,355 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
Technology Partners: 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

726 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