Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > [SWING] Binding selected elements of a JList to a JTable

Reply
Thread Tools

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

 
 
loris_p
Guest
Posts: n/a
 
      03-02-2008
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?
 
Reply With Quote
 
 
 
 
NeoGeoSNK
Guest
Posts: n/a
 
      03-03-2008
On Mar 2, 7:50 pm, loris_p <(E-Mail Removed)> wrote:
> 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"??
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      03-03-2008
NeoGeoSNK wrote:
> On Mar 2, 7:50 pm, loris_p <(E-Mail Removed)> wrote:
>> 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"??


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>

--
Lew
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SWING] How to get selected objects from a JList loris_p Java 3 11-28-2008 06:12 PM
JList as Jtable Render and editor evgchech Java 0 02-26-2007 04:19 PM
jtable/jlist selection using keyboard steve Java 4 11-05-2005 10:11 AM
Speak the contents of the selected JList item(s) danielliuhh@hotmail.com Java 3 01-07-2004 09:24 PM
Getting the previously selected index for JList Jared Java 0 07-31-2003 07:39 AM



Advertisments