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

Discussion in 'Java' started by loris_p, Mar 2, 2008.

  1. loris_p

    loris_p Guest

    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?
     
    loris_p, Mar 2, 2008
    #1
    1. Advertising

  2. loris_p

    NeoGeoSNK Guest

    Re: Binding selected elements of a JList to a JTable

    On Mar 2, 7:50 pm, loris_p <> 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"??
     
    NeoGeoSNK, Mar 3, 2008
    #2
    1. Advertising

  3. loris_p

    Lew Guest

    Re: Binding selected elements of a JList to a JTable

    NeoGeoSNK wrote:
    > On Mar 2, 7:50 pm, loris_p <> 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
     
    Lew, Mar 3, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Don Sykes
    Replies:
    3
    Views:
    706
    Christophe Vanfleteren
    Feb 25, 2004
  2. steve
    Replies:
    4
    Views:
    4,334
    steve
    Nov 5, 2005
  3. evgchech
    Replies:
    0
    Views:
    818
    evgchech
    Feb 26, 2007
  4. loris_p
    Replies:
    3
    Views:
    10,894
    leafdude
    Nov 28, 2008
  5. softwarepearls_com

    Rotating selected Swing JTable column headers?

    softwarepearls_com, Sep 6, 2008, in forum: Java
    Replies:
    2
    Views:
    1,084
    softwarepearls_com
    Sep 7, 2008
Loading...

Share This Page