Solved

Editable JList

Posted on 2001-08-08
6
1,307 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 92

Accepted Solution

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

Expert Comment

by:CleanupPing
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

728 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

10 Experts available now in Live!

Get 1:1 Help Now