Results 1 to 4 of 4
  1. #1
    tfunk92 is offline Member
    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0

    Default Collections and JList

    Ultimatley i have to display the elements of a collection in a JList but im struggling with getting the size of the collection using .size();.

    Java Code:
    public class SchoolChooser extends JPanel {
    
    	private School[] schools;
    	private Object callback;
    	
     SchoolChooser(Object callback){
    	super();
    	
    	School.getCollection();
    	
    	}
    }
    AnyHelp Please?

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: Collections and JList

    WHAT errors are you getting, and, BTW, where are you even ATTEMPTING to use size() in that code, or even a collection.

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,411
    Rep Power
    5

    Default Re: Collections and JList

    Your code has nothing to do with your statement. It's like telling us your struggling to build a brick house and showing us a 2 x 4.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  4. #4
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,719
    Rep Power
    5

    Default Re: Collections and JList

    This question has a history that is exactly three threads thick.

    Its a dupe of: Collections in JList

    And the first question asked contains way more information than this one: Collections
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Collections in JList
    By tfunk92 in forum New To Java
    Replies: 0
    Last Post: 10-29-2013, 06:31 PM
  2. Replies: 4
    Last Post: 01-10-2012, 01:05 PM
  3. Link one JList to another JList
    By mib1bee in forum AWT / Swing
    Replies: 1
    Last Post: 12-31-2010, 07:10 PM
  4. Link one JList to another JList
    By mib1bee in forum Advanced Java
    Replies: 1
    Last Post: 12-30-2010, 06:35 PM
  5. Link one JList to another JList
    By mib1bee in forum New To Java
    Replies: 1
    Last Post: 12-30-2010, 06:24 PM

Tags for this Thread

Posting Permissions

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