Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFileChooser's "Detail View" JTable

 
Shepard Plowden
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Rob Spoor
Sheriff
Pie
Posts: 20529
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't it already break if you switch UI?
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably can. I mostly limit my research to the default Metal LaF.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic