Java如果应用程序是jar文件格式,如何显示JTree文件模型

时间:2022-03-29 12:33:05

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?

我有一个应用程序,JTree将在特定目录中显示文件。在我将这个应用程序导出到jar文件之后。JTree不能从目录中读取文件。任何想法?

1 个解决方案

#1


0  

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.

你把文件装进罐子里了吗?如果想让应用程序以.jar的形式运行,就不能使用该jar中不存在的资源。

#1


0  

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.

你把文件装进罐子里了吗?如果想让应用程序以.jar的形式运行,就不能使用该jar中不存在的资源。