aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Need Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need "file displaying UI" like JFileChooser Watch "Need "file displaying UI" like JFileChooser New topic
Author

Need "file displaying UI" like JFileChooser's. How to get it?

Florin Constantinescu
Greenhorn

Joined: Oct 26, 2009
Posts: 10
I need to use a file displaying UI which looks like the correspondent which JFileChooser uses. Just that component(the one which
contains the JTable used for the "Details" option in the popup menu, etc). But how to obtain it? I've looked in JFileChooser.java and
BasicFileChooserUI.java, but it seems that the UI it is assembled somehow "on the fly", using UIManager's facilities and some other
things(a very complicated approach). I was hoping rather that it exists something already wrapped in an object and used.
Is there such a thing somewhere in the JDK?
santhosh varala kumar
Greenhorn

Joined: Nov 05, 2009
Posts: 25
Florin Constantinescu wrote: I need to use a file displaying UI which looks like the correspondent which JFileChooser uses. Just that component(the one which
contains the JTable used for the "Details" option in the popup menu, etc). But how to obtain it? I've looked in JFileChooser.java and
BasicFileChooserUI.java, but it seems that the UI it is assembled somehow "on the fly", using UIManager's facilities and some other
things(a very complicated approach). I was hoping rather that it exists something already wrapped in an object and used.
Is there such a thing somewhere in the JDK?


Can you please provide proper expected screenshot?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

Why can't you create a simple JTable yourself with that data? Because it's not that hard to retrieve the data, as this little example shows:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Florin Constantinescu
Greenhorn

Joined: Oct 26, 2009
Posts: 10
santhosh varala kumar wrote:
Can you please provide proper expected screenshot?


Here is the screenshot:




[Thumbnail for jfc.jpg]

Florin Constantinescu
Greenhorn

Joined: Oct 26, 2009
Posts: 10
Rob Prime wrote:Why can't you create a simple JTable yourself with that data? Because it's not that hard to retrieve the data, as this little example shows:


Well, I will create it if there isn't another possibility. The thing is that a simple JTable wouldn't do quite right the job for several reasons like:

1. I will have to name myself the table's columns, and a more complex approach of the application will require language support(and I will have to build it).
2. I will have to create more than a JTabel; some JLists too(these correspond to the other options which could exist in the popup menu - Icons, List, etc). Adding the sorting
functions which are required and the popup menu, it will take some work&time to be done.
3. If there's already something like this build up and works, why not use it?

Although, I think I'll give it a try, building myself the UI. But if some new information comes up....

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need "file displaying UI" like JFileChooser's. How to get it?