Results 1 to 5 of 5
- 03-21-2009, 01:57 PM #1
[SOLVED] JList( Vector ) Display problem
I have a JList initialized with a vector of objects. I want the JList to display a specific variable from each object in question, but so far it displays the class name and some seemingly random letters and numbers.
I've been reading all morning and can't find an example for how to make it present a variable from the object instead.
Can someone point me in the right direction?
What is the toString() method for the objects in the arraylist (I think I already know the answer to this)?
- 03-21-2009, 02:03 PM #3
Figured it out. Turns out JLists return the value of the objects toString Method. Just had to write one for my object.
good deal. How did you figure this out? my post, or another forum?
- 03-21-2009, 03:28 PM #5
- By aneesahamedaa in forum AWT / SwingReplies: 2Last Post: 09-04-2008, 08:49 AM
- By willemjav in forum Java AppletsReplies: 10Last Post: 06-11-2008, 02:28 PM
- By java_fun2007 in forum New To JavaReplies: 2Last Post: 05-07-2008, 08:58 PM
- By zizou147 in forum Advanced JavaReplies: 1Last Post: 04-17-2008, 08:50 AM
- By Ace_Of_John in forum New To JavaReplies: 1Last Post: 01-27-2008, 09:53 PM