Results 1 to 4 of 4
  1. #1
    karq is offline Member
    Join Date
    May 2010
    Posts
    63
    Rep Power
    0

    Default Swing lables array

    Hey,

    I want to display content of an arraylist in a swing gui. Maybe someone can give me some tips how to make a loop that make a label for every arraylist element?

    Cheers.
    karq

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,226
    Rep Power
    6

    Default

    Maybe you should use a JList. Read the API for JList and follow the link to the Swing tutorial on "How to Use Lists".

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default

    make a loop that make a label for every arraylist element
    You have an arraylist that contains elements. You want to create a label for every element in the arraylist.
    Where are you going to save the references to the labels you create?
    How are you going to display these labels that you are creating?

  4. #4
    karq is offline Member
    Join Date
    May 2010
    Posts
    63
    Rep Power
    0

    Default

    Quote Originally Posted by camickr View Post
    Maybe you should use a JList. Read the API for JList and follow the link to the Swing tutorial on "How to Use Lists".

    Thanks for the recommendation, Jlist worked great :)

Similar Threads

  1. Convert Char Array to String Array
    By Mayur in forum New To Java
    Replies: 8
    Last Post: 10-12-2009, 11:41 AM
  2. Replies: 1
    Last Post: 03-31-2009, 06:40 AM
  3. using javax.swing.JOptionPane in array
    By icedragon770 in forum AWT / Swing
    Replies: 12
    Last Post: 11-10-2008, 08:27 AM
  4. Replies: 6
    Last Post: 04-07-2008, 03:57 AM
  5. map javax.swing.text.Element to javax.swing.text.View
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 07-30-2007, 07:02 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
  •