如何将Java桌面应用程序移植到Netbeans 7.1 [英] How do I port a Java Desktop Application to Netbeans 7.1

查看:83
本文介绍了如何将Java桌面应用程序移植到Netbeans 7.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Netbeans 6中,我基于Java桌面应用程序(org.jdesktop.application.SingleFrameApplication)编写了一个相当复杂的应用程序.

In Netbeans 6, I wrote a fairly complex application based on the java desktop application (org.jdesktop.application. SingleFrameApplication).

Swing应用程序框架已从7.1中删除,我现在无法编辑表单. 我已经看过了移植到Netbeans平台的示例,但是它们似乎并未涵盖从桌面应用程序进行迁移的过程.

The Swing Application Framework has been removed from 7.1 and I now cannot edit the forms. I have been through the the examples of porting to the Netbeans Platform but they don't seem to cover migrating from a desktop application.

任何帮助都将受到欢迎.

Any help would be welcome.

推荐答案

不幸的是,Swing应用程序框架已被弃用并删除.它从未成为最终的JSR,并且在这一点上已经完全消亡(因为JavaFX被认为是Java UI的未来).

Unfortunately the Swing Application Framework was deprecated and removed. It never became a final JSR, and at this point is fully dead (since JavaFX is considered the future of Java UIs).

要运行您的应用程序,请从NetBeans的较旧版本(也可能已将其插入应用程序的lib目录中)中复制swing应用程序jar.您仍然应该可以使用此jar运行.

To make your app run, copy the swing app jars from an older copy of NetBeans (they may have been inserted into your app's lib directory as well). You should still be able to run with this jar.

要对实际表单进行进一步更改,您基本上只有两个选择:使用标准表单生成器完全重新创建它们,或将其编辑为代码,而不是直观地进行编辑.您可以丢弃.form文件,因为它们现在已无用.相反,您可以在表单的java类中修改生成的代码.它仍然是丑陋的代码,但至少现在可以编辑了.您可能需要删除NetBeans用来标记代码块为不可编辑的魔术注释.

To make further changes to the actual forms you basically have just two options: completely recreate them with the standard form builder or edit them as code instead of visually. You can throw away the .form files, since they are useless now. Instead you can modify the generated code inside the form's java class. It's still rather ugly code, but at least it will be editable now. You may need to remove the magic comments that NetBeans uses to mark blocks of code as uneditable.

这篇关于如何将Java桌面应用程序移植到Netbeans 7.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆