Results 1 to 5 of 5
  1. #1
    SpO0KIe is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default Help with JList selection showing values on another JList

    Hello!

    So I've got a homework to do and I need to make a application for a made-up game developer company.
    I've done a JList that lists all employees from a database and what I now need to do is, when I select one of the employees another JList needs to be filled, with the information: the domain the employee works on (it can be several)

    Now I have a tabel that is called employee and you can get the ID from every employee and I also have a table for the domains (you can see domain ID).
    I've made a final table that shows only Employee ID and Domain ID, meaning you can see on what domain a employee works.

    now back to java...
    What I need is: When I select one of the employees, the domain(s) the selected employee is working on should be listed on another JList.

    I don't really know how to make this work, and I don't know if I explained this good enough for you to understand but.. What I know is that I need to get the EmployeeID from the selected employee and then somehow connect it to a SQL question in order to get all the domains the selected employee works on, am I right?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,305
    Rep Power
    20

    Default Re: Help with JList selection showing values on another JList

    Moved from 'New to Java'

    When I select one of the employees, the domain(s) the selected employee is working on should be listed on another JList.
    Start by reading the API for JList and follow the link to the Swing tutorial on How to Use Lists.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    SpO0KIe is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default Re: Help with JList selection showing values on another JList

    Yeah, I would like to thank you for your answer!
    I have read throught the whole API (JList) and did not find anything I could use, or atleast that's what I think.
    And I don't really know where to go when you were reffering to "How to Use Lists", I did look for it in the tutorial section (That was what you meant, right here on this forum?).

    EDIT: Maybe I was unclear and didn't explain good enough in my first post but you can say that "I need help with populating a subcategory JList based on a selection from a Primary JList and info in a database"
    Last edited by SpO0KIe; 01-09-2012 at 10:56 PM.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  5. #5
    SpO0KIe is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default Re: Help with JList selection showing values on another JList

    No shit sherlock..No I didn't mean to be rude, sorry.. but I found that maybe it is "Object[] getSelectedValues()" I need to use, but how can I use it get a value from the selection? I have already put in several values into every employee but I don't know how to select one specific.

Similar Threads

  1. Link one JList to another JList
    By mib1bee in forum AWT / Swing
    Replies: 1
    Last Post: 12-31-2010, 07:10 PM
  2. Link one JList to another JList
    By mib1bee in forum Advanced Java
    Replies: 1
    Last Post: 12-30-2010, 06:35 PM
  3. Link one JList to another JList
    By mib1bee in forum New To Java
    Replies: 1
    Last Post: 12-30-2010, 06:24 PM
  4. jList border showing up even if setVisible is false
    By amarjoshi in forum AWT / Swing
    Replies: 1
    Last Post: 10-04-2010, 06:29 AM
  5. Showing JList in a JPanel
    By nico.hvi in forum AWT / Swing
    Replies: 0
    Last Post: 03-10-2010, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •