can s
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.
can s
Last edited by adem2660; October 3rd, 2014 at 05:22 PM. Reason: typo
The code populates the JComboBox from the hotelArr array OK for me.I need it to do is to populate the drop down list in the JComboBox with the hotel information
I've defined it like this for testing:Object[] hotelArr = {"line 1", "line 2", "line 3"}; // getHotelInfo() };
If you don't understand my answer, don't ignore it, ask a question.
I think I might've misunderstood you.
That piece of code you just provided me with only adds "line 1", "line 2", "line 3" to the list. It doesn't take anything from the getHotelInfo? (but then again, that's commented out).
It should take the information that is stored in my ArrayList and put it there instead of handwritten text (i.e. "line 1" etc).
Thanks for answer, though!
Please copy what is printed out and paste it here.I can print out the content of the ArrayList perfectly fine, but when I try to do it in my GUI class it just prints empty brackets "[]"
--- Update ---
Also posted at: [Beginner] Populate JComboBox With ArrayList. - Java | Dream.In.Code
Please read: http://www.javaprogrammingforums.com...s-posting.html
If you don't understand my answer, don't ignore it, ask a question.