• Post Reply Bookmark Topic Watch Topic
  • New Topic

String[] Into a JList  RSS feed

 
Mikasa Jaeger
Greenhorn
Posts: 24
Chrome Google App Engine Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, im trying to put a String [] into a JList.

This is my code:



But in the jList only apears: [L.java.lang.string:@22c25..
How can do this right?

Thanks
 
Matthew Brown
Bartender
Posts: 4568
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"[L.java.lang.string:@22c25.." is the result of the toString() method on an array object.

Do you really want to add a String[] to the JList? Or do you want to add each element in the String[]? I'd guess the latter. If so, try iterating over the String[] and adding each String separately.
 
Mikasa Jaeger
Greenhorn
Posts: 24
Chrome Google App Engine Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, you were right!
It worked! Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!