1

I created a small swing application having some GUI components and some java code. When I run it from the IDE, I see GUI open and it works as expected. Now I want to distribute this application to others and it will be run on different machines. I am just wondering as how could I distribute it?

Under project folder, I see following -

-dist
--lib
----some required jar files
--project.jar

-build
--classes
----packagename folder -->UI classes
----projectnamefolder--->projectname.class
--empty
--generated-sources

I am using Windows 7 64 bit with jdk 1.7. Earlier I was able to distribute such apps and they worked from command line or by double clicking .jar file.

Is there anything different in case of swing apps? Kindly suggest.

If I run from command prompt the jar file located under dist folder, it doesn't throw any error but no GUI appears.

enter image description here

4

2 回答 2

1

按照LINK中的这些步骤操作,其他系统将需要 JRE 才能运行。

我想你不见了swing-layout-1.0.jar

添加 Swing 布局扩展库:

右键单击项目的库节点并选择添加库。

在添加库对话框中,选择 Swing Extensions 布局并单击添加库。

单击“确定”关闭“项目属性”对话框。


除了按照 Shiv 的建议进行操作之外,我还关注了链接,它点击了我,因为我做错了什么。

于 2013-09-19T10:42:55.610 回答
1

现在我想将此应用程序分发给其他人,它将在不同的机器上运行。我只是想知道如何分发它?

对于部署 Java 桌面应用程序,最好的选择通常是安装该应用程序。使用Java Web 开始。JWS 适用于 Windows、OS X 和 *nix。

..听起来很酷,会搜索一些教程以了解如何使用它

信息。上面链接的 SO 页面包括对 JWS 投票最多的 SO 发帖人的收集知识(我 ;))。它还包括指向教程和其他信息的链接列表。

于 2013-09-19T11:18:31.847 回答