[SWING] Binding selected elements of a JList to a JTable

L

loris_p

Hi, I have a JTable bound to a List of Movements. Every movement has a
List of Users. I need a JList with selected elements bound to the
users contained in the List of the selected movement. I'm using
Netbeans 6.01. If I use the binding menu and bind selected elements to
${selectedElement.users} of the table it doesn't work. Any idea?
 
N

NeoGeoSNK

Hi, I have a JTable bound to a List of Movements. Every movement has a
List of Users. I need a JList with selected elements bound to the
users contained in the List of the selected movement. I'm using
Netbeans 6.01. If I use the binding menu and bind selected elements to
${selectedElement.users} of the table it doesn't work. Any idea?

:)
I have no idea, may be you can find the answer from the group
"comp.lang.java.gui"??
 
L

Lew

NeoGeoSNK said:
:)
I have no idea, may be you can find the answer from the group
"comp.lang.java.gui"??

clj.programmer isn't that far off, and the readership is basically the same,
so encouraging the OP to multi-post probably isn't a good idea.

The use of '${selectedElement.users}' gives me pause - isn't that JSP EL?

Anyway, absent any code examples let's assume that 'selectedElement' is the
name of the primary JList. JLists do not have an attribute called 'users', so
there's no way for such an expression to be meaningful.

I think you have to actually create a backing ListModel (or equivalent) from
the selected items, and assign it as the model for the subsidiary JList.

Also, you really need to read and learn
<http://mindprod.com/jgloss/sscce.html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top