Results 1 to 5 of 5
- 03-21-2009, 12: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.e. Object@d4g3s3
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, 01: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, 02:28 PM #5
Similar Threads
-
How do I display a JList with icons and text?
By aneesahamedaa in forum AWT / SwingReplies: 2Last Post: 09-04-2008, 08:49 AM -
JList and records, what to do to solve the problem
By willemjav in forum Java AppletsReplies: 10Last Post: 06-11-2008, 02:28 PM -
Problem with JComboBox and Jlist
By java_fun2007 in forum New To JavaReplies: 2Last Post: 05-07-2008, 08:58 PM -
JList problem
By zizou147 in forum Advanced JavaReplies: 1Last Post: 04-17-2008, 08:50 AM -
Vector problem
By Ace_Of_John in forum New To JavaReplies: 1Last Post: 01-27-2008, 08:53 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks