[英]What's the easiest way to show a Windows Explorer-type file structure in Java Swing?
I thought I'd ask in case someone else has run into this before. 我以为我会问别人是否曾经遇到过这种情况。
How would you go about showing the user's file directory structure in a Java applet, something like Windows Explorer? 您将如何在Java小程序(例如Windows资源管理器)中显示用户的文件目录结构?
Would I have to create a JTree and manipulate that, or is there an easier way? 我必须创建一个JTree并对其进行操作,还是有一种更简单的方法?
The easiest way is to use a FileChooser . 最简单的方法是使用FileChooser 。 Your applet needs to be a signed applet so it could access the client file system, here a small article regarding this
你的小程序需要一个签名的小,因此它可以访问客户端文件系统,在这里一个小文章对此
I think JTree would be the easiest way. 我认为JTree是最简单的方法。
but if you just want it to view files before you load them then use a file chooser . 但是如果您只希望它在加载文件之前先查看文件,则可以使用文件选择器 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.