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.
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.
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.
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.
Okay, thanks. I may have to do it that way, at lest temporarilly.
Take a look at the LimeWire cvs.