如果应用程序是jar文件格式,Java如何显示JTree文件模型
我有一个 JTree 应用程序将显示某个目录中的文件。我将此应用程序导出到 jar 文件后。 JTree 无法从目录中读取文件。有什么想法吗?
I had an application with JTree will display the file in certain directory. After i export this application to jar file. The JTree can not read the file from the directory. Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你把文件打包到jar了吗?如果您尝试让应用程序作为 .jar 运行,则无法使用该 jar 中不存在的资源。
Did you bundle the file into the jar? If you're trying to get your application to run as .jar, you can't use resources that don't exist in that jar.