The Artima Developer Community
Sponsored Link

Java Answers Forum
Adding icons to JList

1 reply on 1 page. Most recent reply: Feb 20, 2004 1:53 AM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Daniel Liu

Posts: 11
Nickname: hhliu
Registered: Feb, 2004

Adding icons to JList Posted: Feb 17, 2004 4:16 AM
Reply to this message Reply
Advertisement
Hello,

Does any one know how to add icons to JList?

Where could I find this kind of samples?

Thanks,

Daniel


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Adding icons to JList Posted: Feb 20, 2004 1:53 AM
Reply to this message Reply
1. create a class which is able to store text and icons.
2. add an instance of this class as an item to the list.
3. You have to write a list cell renderer.
this one should return a label with icon and text or whatever you want.

Flat View: This topic has 1 reply on 1 page
Topic: Java Error Class Previous Topic   Next Topic Topic: can  cmp entity bean use microsoft access as a database?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use