Results 1 to 3 of 3

Thread: JList problem?

  1. #1
    tom2zip is offline Member
    Join Date
    Nov 2011
    Posts
    11
    Rep Power
    0

    Default JList problem?

    im trying to display the String from a text file on the JList and the text file contains tabs
    my question is, why won't JList read the tabs?
    i clearly added the tab between the two text segments but it won't show up on the list

    for(int n=0; n<=pairs.size()-1; n++)
    {
    listModel.addElement(pairs.get(n).word + "\t" + pairs.get(n).definition);
    }


    is there a solution to this problem?

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: JList problem?

    How did you want the tab to show up? If the intention is for the definitions to line up you could use a JTable.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: JList problem?

    Moved from 'New to Java'

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

Similar Threads

  1. Problem With jList
    By amitabh in forum NetBeans
    Replies: 3
    Last Post: 06-03-2010, 06:28 AM
  2. JList and records, what to do to solve the problem
    By willemjav in forum Java Applets
    Replies: 10
    Last Post: 06-11-2008, 02:28 PM
  3. Problem with JComboBox and Jlist
    By java_fun2007 in forum New To Java
    Replies: 2
    Last Post: 05-07-2008, 08:58 PM
  4. JList problem
    By zizou147 in forum Advanced Java
    Replies: 1
    Last Post: 04-17-2008, 08:50 AM

Posting Permissions

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