Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Displaying things in gui

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Location
    Dublin
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Displaying things in gui

    Hello.

    I was wandering how to display a content of an ArrayList in a GUI??

    I tried to do this in this way:
    for(int i = 0;i<student.size(); i++){
     
    			JOptionPane.showMessageDialog(null, student.get(i).getName()
    				   + " " + student.get(i).getSurname()
    				   + " " + student.get(i).getGradesString()
    				   + "\n");
    		}

    but it did not work and it was displaying dialog box one after another.
    What i would like is to display all this informations all at once in one window.

    Could anyone give me some tips on how to do this??

    Regards


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Displaying things in gui


  3. The Following User Says Thank You to copeg For This Useful Post:

    KrisTheSavage (March 28th, 2010)

  4. #3
    Junior Member shadihrr's Avatar
    Join Date
    Jan 2010
    Location
    home
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Displaying things in gui

    you could add the arraylist's content to a string and use JOptionPane to show your string

Similar Threads

  1. XML, and other things.
    By Tortex in forum The Cafe
    Replies: 0
    Last Post: March 27th, 2010, 03:33 PM
  2. How would i do these things??
    By Curious in forum Java Theory & Questions
    Replies: 4
    Last Post: February 21st, 2010, 08:33 PM
  3. Need help with String Trimming.. and displaying Keys on maps.
    By bh-chobo in forum Algorithms & Recursion
    Replies: 1
    Last Post: November 9th, 2009, 01:15 PM
  4. [SOLVED] displaying sum of harmonic series
    By sriraj.kundan in forum Algorithms & Recursion
    Replies: 2
    Last Post: June 15th, 2009, 11:42 PM
  5. [SOLVED] Prime number generator program in Java
    By big_c in forum What's Wrong With My Code?
    Replies: 5
    Last Post: April 27th, 2009, 12:08 PM