JList


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: JList

  1. #1
    Join Date
    Feb 2005
    Posts
    55

    JList

    I have a driver class and i want to have a JList dispaying only the name and surname of the driver on the same line.
    I have all the details in the vector called driverInformation. Can you please tell me how i can do this currently i have all the information of the drivers on separate lines.

  2. #2
    Join Date
    Sep 2004
    Posts
    223
    could you show us some code?
    A kram a day keeps the doctor......guessing

  3. #3
    Join Date
    Feb 2005
    Posts
    55
    private JList list;
    list = new JList(driverInfo);
    list.setSelectedIndex(0);
    list.setFixedCellWidth(300);
    list.setVisibleRowCount(4);
    list.setSelectionMode(ListSelectionModel. SINGLE_SELECTION);

    in the driver class i have

    public void etFirst(String n);
    {
    name = n;
    }

    public String getName()
    {
    return name;
    }

    public void setSurname(String s)
    {
    surname = s;
    }

    public String getSurname()
    {
    return surname;
    }

  4. #4
    Join Date
    Sep 2004
    Posts
    223
    try this site:
    http://java.sun.com/docs/books/tutor...ents/list.html

    its pretty good...

    sorry i couldnt help you directly
    A kram a day keeps the doctor......guessing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center