Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I start the JFileChooser in the Details view?

I would like my JFileChooser to start in details view, instead of the "List" view that it starts in. How do you do that?

like image 666
Daniel Kaplan Avatar asked Apr 30 '13 05:04

Daniel Kaplan


1 Answers

You can get the Action from the ActionMap:

JFrame frame = new JFrame();
JFileChooser  fileChooser = new JFileChooser(".");
Action details = fileChooser.getActionMap().get("viewTypeDetails");
details.actionPerformed(null);
fileChooser.showOpenDialog(frame);
like image 79
camickr Avatar answered Nov 01 '22 11:11

camickr