FileRenderer

Hi there all,

I'm trying to create a Jlist that will show either a folder or file that I have added to it from a JFileChooser. I've been able to create my own ListCellRenderer but was wondering if there is not already something out there.

Secondly I would like to create my own Cell Renderer but require the icons, does any one know how I could use the system icons from my program for this?

Thanks

[426 byte] By [tarmenela] at [2007-11-27 11:57:39]
# 1

You can use the renderer from http://www.pushing-pixels.org/?p=58

kirillga at 2007-7-29 19:15:08 > top of Java-index,Desktop,Core GUI APIs...
# 2

Here is a way to obtain the icons used by the file system to display any particular file or folder.

Use the javax.swing.filechooser.FIleSystemView.

This class has a getSystemIcon( ) which returns the icon used by the local file system for any file at all.

It also contains several useful methods which you can use to make your renderer complete. I would suggest you build your renderer from scratch cause it would help you learn and also it would be tailored for your specific requirements in your app.

ICE

icewalker2ga at 2007-7-29 19:15:08 > top of Java-index,Desktop,Core GUI APIs...
# 3

Thanks, I will take a look at it. Looks promising:)

tarmenela at 2007-7-29 19:15:08 > top of Java-index,Desktop,Core GUI APIs...