Valhalla Legends Archive

Programming => General Programming => Java Programming => Topic started by: DOOM on November 11, 2003, 06:22 PM

Title: JList help in Java
Post by: DOOM on November 11, 2003, 06:22 PM
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.
Title: Re:JList help in Java
Post by: iago on November 11, 2003, 06:30 PM
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.
Title: Re:JList help in Java
Post by: DOOM on November 12, 2003, 12:03 AM
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.
Title: Re:JList help in Java
Post by: iago on November 12, 2003, 12:24 AM
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.
Title: Re:JList help in Java
Post by: DOOM on November 12, 2003, 01:59 PM
Okay, thanks.  I may have to do it that way, at lest temporarilly.
Title: Re:JList help in Java
Post by: Banana fanna fo fanna on November 12, 2003, 02:15 PM
Take a look at the LimeWire cvs.