This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JFileChooser's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFileChooser Watch "JFileChooser New topic
Author

JFileChooser's "Detail View" JTable

Shepard Plowden
Greenhorn

Joined: Nov 19, 2012
Posts: 1
Does anyone have code or can point me to: how to set JFileChooser's "Detail View" JTable to AUTO_RESIZE_ALL_COLUMNS ?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4952
    
    8

You can drill down to the JList that represents the list view, get a reference to its ancestor of class sun.swing.FilePane, then add a ContainerListener to the FilePane that listens for a componentAdded(...) and drills down to determine whether there is a JTable in its hierarchy. Then set the autoResizeMode of that JTable.

I'm curious: why is this behavior important (or even desirable)?

edit: Note that this is totally implementation dependent and may break in a future release of Swing (if there ever is one).


luck, db
There are no new questions, but there may be new answers.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20050
    
  30

Can't it already break if you switch UI?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4952
    
    8

Probably can. I mostly limit my research to the default Metal LaF.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFileChooser's "Detail View" JTable
 
It's not a secret anymore!