如何在“详细信息”视图中启动JFileChooser? [英] How can I start the JFileChooser in the Details view?

查看:114
本文介绍了如何在“详细信息”视图中启动JFileChooser?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的JFileChooser能够在详细信息视图中启动,而不是从它开始的List视图开始。你是如何做到的?

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

推荐答案

你可以从ActionMap获取Action:

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);

这篇关于如何在“详细信息”视图中启动JFileChooser?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆