Results 1 to 6 of 6
  1. #1
    shade73 is offline Member
    Join Date
    Aug 2008
    Posts
    3
    Rep Power
    0

    Default [SOLVED] JList or JTable?

    So this is a newbie question, but it's one I'm trying to get confirmed anyway :).

    - If I'm doing multi-column work would I be better served to use a jTable or a jList?

    - If I don't want it to show the "grid" in the columns of a JTable what's the best way to change it? I changed it by making the grid color white, but I wasn't sure if that was the "proper" way to change the option.

    Thanks all!

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Did you read any doc related to JList and JTable? JList is a list, I mean you can have multiple line on a single column. In JTable you have multiple rows(lines) as well as columns.

    showHorizontalLines() and showVerticalLines() used to show/hide grids on a JTable.

  3. #3
    shade73 is offline Member
    Join Date
    Aug 2008
    Posts
    3
    Rep Power
    0

    Default

    "So this is a newbie question"
    - maybe you missed that part.

    Yes I read the doc, and I saw no where that it specifically said didn't support multi column usage, but thanks for answering the question.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    No I see that you are a newbie, but that doesn't mean someone give a full solution to you. You have to try something first and ask any question if you stuck with. :)

    Anyway, now whats up. Did you solve the question?

  5. #5
    shade73 is offline Member
    Join Date
    Aug 2008
    Posts
    3
    Rep Power
    0

    Default

    Yep, that solved it. I was really hoping to use jList because I felt like it was a "simpler" implementation. Actually it was just more like what I was already used to.

    The vertical and horizontal lines work great. The only reason I did the backgorund change is because I remember about 2 years ago I was looking for that solution in one of the languages I was using and that was what they suggested. I thought it was a goofy way to do it, but it worked at the time :P.

    Thanks for the help!

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    It's pleasure to help you. So now the time to mark this thread solved, if you don't have any further questions related to this. It's really helpful to all other members.

Similar Threads

  1. JList and JPanels
    By JetsYanks in forum New To Java
    Replies: 8
    Last Post: 12-25-2009, 02:11 PM
  2. Replies: 2
    Last Post: 05-15-2008, 10:15 AM
  3. JList problem
    By zizou147 in forum Advanced Java
    Replies: 1
    Last Post: 04-17-2008, 08:50 AM
  4. searching within a JList
    By newtojava7 in forum New To Java
    Replies: 1
    Last Post: 03-10-2008, 12:12 AM
  5. Help with JList
    By Albert in forum NetBeans
    Replies: 1
    Last Post: 07-13-2007, 03:42 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
  •