Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Java ArrayLists to GUI

    I'm using a JFrame to make a program where you can search for music.
    When you have searched it should show some info.
    So i have 4 arrayLists(Name,Type,Price,Year).
    These arrayLists need to be shown as a list in my GUI kinda like this.
    ( http://i.imgur.com/U5RW2.png )

    Now my question is, What is the best way to show this?
    Is it JTable?

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    You can't use 4x ArrayList as there isn't a real relationship between them. Use a Vector of Vectors, or you can write a custom TableModel to do this with. JTable does make the most sense for what you are trying to display though.


  •  

    Tags for this Thread

    Posting Permissions

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