| Author |
Best Way to Display Icons
|
Isaac Hewitt
Ranch Hand
Joined: Jul 24, 2006
Posts: 179
|
|
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
Joined: May 03, 2008
Posts: 4201
|
|
|
Just add the Icons (not JLabels) to a DefaultListModel and display them in a JList with the layoutOrientation set to HORIZONTAL_WRAP.
|
luck, db
There are no new questions, but there may be new answers.
|
 |
Isaac Hewitt
Ranch Hand
Joined: Jul 24, 2006
Posts: 179
|
|
Ok Darryl,
I will try displaying the icons in a JList as you have suggested.
Thanks for the hint.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
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:
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Isaac Hewitt
Ranch Hand
Joined: Jul 24, 2006
Posts: 179
|
|
|
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
Joined: Oct 27, 2005
Posts: 19232
|
|
|
You're welcome, but it's Rob, not Bob.
|
 |
 |
|
|
subject: Best Way to Display Icons
|
|
|