• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best Way to Display Icons

 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to display icons much in the same way they are seen displayed in any window of Windows. I am using the following code to fetch the icons.



I just want to know what container is the best to diplay them in a FlowLayout.
Thanks.
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just add the Icons (not JLabels) to a DefaultListModel and display them in a JList with the layoutOrientation set to HORIZONTAL_WRAP.
 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Darryl,

I will try displaying the icons in a JList as you have suggested.

Thanks for the hint.
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you don't use ShellFolder; it's in a package that starts with sun, and classes in these packages (along with sunw and com.sun) can change drastically (or even be dropped) between releases.

The good news is that you can use ShellFolder through a class that's in the API - FileSystemView:
 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Bob. I just now got back to this forum and saw that you were the last one to post a comment. I will use what you posted in the place of the shell method. Thanks alot for taking the time to post it and sorry for the late response.
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome, but it's Rob, not Bob.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic