The Artima Developer Community
Sponsored Link

Java Answers Forum
Editing in a JList

3 replies on 1 page. Most recent reply: Apr 28, 2005 2:24 AM by Ralf Kraus

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Editing in a JList Posted: Apr 20, 2005 5:32 AM
Reply to this message Reply
Advertisement
I'd like to create a list rows of options based on a database.
Every row should have a Checkbox and some info.

So I created a class based on JPanel to display all the stuff and wrote a ListCellrender for my JList object to show it.

But I can't change the value of the checkbox.

This is the first time I try it with a JList, until now I did such things with a JTable.
Only now I realized I can't set a Editor for the ListCell.

Is that normal?
Is there a way to make the content editable?

Or do I have to use a JTable?


Thomas Eichberger

Posts: 4
Nickname: xtraclass
Registered: Aug, 2003

Re: Editing in a JList Posted: Apr 22, 2005 6:45 AM
Reply to this message Reply
A JList is for displaying only, as stated in the documentation.

Just use a one-column JTable:-)

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Editing in a JList Posted: Apr 26, 2005 12:26 AM
Reply to this message Reply
I juste hoped there would be another way.

I recreated the list using JTable and it works pretty good.

But I'm not able to make it look exactly like a JList (background, cell separator lines, headers). There are allways differences.

Ralf Kraus

Posts: 2
Nickname: darkvamp
Registered: Apr, 2005

Re: Editing in a JList Posted: Apr 28, 2005 2:24 AM
Reply to this message Reply
Hi,

there are many (open sourced) extended JTable versions flying around just look for it in google....

Greets -Ralf-

Flat View: This topic has 3 replies on 1 page
Topic: I neeed help on java compiler Previous Topic   Next Topic Topic: adding text fields

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use