About JList

Hi,Can I show in JList more then one column? (I need list, not table).Thanks
[97 byte] By [bronze-starDukes] at [2007-11-26 12:15:05]
# 1
Why not JTable? you can configure it to look like JList, also can concat the col values with a space and add the whole to the JList.
bronzestar at 2007-7-7 14:18:30 > top of Java-index,Archived Forums,Socket Programming...
# 2
No, I want to use with list, I have list model in my code..Do you know if it is posiable?Thanks
bronzestar at 2007-7-7 14:18:30 > top of Java-index,Archived Forums,Socket Programming...
# 3
put two jlist side by side or use html tags in jlist
bronzestar at 2007-7-7 14:18:30 > top of Java-index,Archived Forums,Socket Programming...
# 4
Use a custom renderer. This posting shows the concept: http://forum.java.sun.com/thread.jspa?forumID=57&threadID=707295
platinumsta at 2007-7-7 14:18:30 > top of Java-index,Archived Forums,Socket Programming...
# 5
I'd extend DefaultListModel to implement TableModel. Then you have a single model you can use in either component.
silverstar at 2007-7-7 14:18:30 > top of Java-index,Archived Forums,Socket Programming...
# 6
Thanks!!!! :)
bronzestar at 2007-7-7 14:18:30 > top of Java-index,Archived Forums,Socket Programming...
# 7

Hi..

How cat I get this:

the renderer shows me all my whanted value (it's work fine),

but, I whant to set spcipic value in every row in the list.

I mean, if I selected index 0, then I get just the id as selected value.

now I get value unknow because my rendere show:

checkBox, id, name.

I want to set as value only the id, but show this data (checkBox, id, name)

I was traied to creat a table, but it is not good to my code..

bronzestar at 2007-7-7 14:18:30 > top of Java-index,Archived Forums,Socket Programming...