Valhalla Legends Forums Archive | Java Programming | JList help in Java

AuthorMessageTime
DOOM
Hey everyone. I need to be able to add an icon along with a string to a JList in Java. For example, if someone joins using the client Starcraft, I want to add the [STAR] icon and their username to the JList. Any help would be appreciated, thanks.
November 12, 2003, 12:22 AM
iago
I'm not sure that JList can do that. I'm not really sure how you would do that in Java, but I've thought about it before. I can ask a prof at school later this week, if nobody else knows.
November 12, 2003, 12:30 AM
DOOM
Well I've heard some stuff about having to add a DefaultListModel to the JList to do it, but I haven't really found any helpful information on how exactly to get it to work right. I've gotten it to add an icon or add a string. The problem is that it will add the icon on one line and then the text on the next line, which isn't what I'm looking for. I don't know, it's been a big pain in the ass for me so far. Thanks for the help though. If you could remember to ask your prof I'd appreciate it.
November 12, 2003, 6:03 AM
iago
It's not THAT important, though, for now I'd just do something like, "[STAR] iago", assuming you're trying to write a bot.

Edit: ah, good, you did say that's what you wanted.
November 12, 2003, 6:24 AM
DOOM
Okay, thanks. I may have to do it that way, at lest temporarilly.
November 12, 2003, 7:59 PM
St0rm.iD
Take a look at the LimeWire cvs.
November 12, 2003, 8:15 PM

Search