如何在java swing库中浏览文件? [英] How to browse for a file in java swing library?
本文介绍了如何在java swing库中浏览文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道java swing库中是否有某种J工具可以打开文件浏览器窗口并允许用户选择文件。然后文件的输出将是所选文件的绝对路径。
I was wondering if there was some kind of J tool in the java swing library that opens up a file browser window and allows a user to choose a file. Then the ouput of the file would be the absolute path of the chosen file.
提前致谢,
推荐答案
您可以使用 JFileChooser 课程,请查看此示例 。
You can use the JFileChooser class, check this example.
这篇关于如何在java swing库中浏览文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文