How do I port a Java Desktop Application to Netbeans 7.1

半城伤御伤魂 提交于 2019-12-02 06:06:14

问题


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

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.


回答1:


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).

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.

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.



来源:https://stackoverflow.com/questions/11096999/how-do-i-port-a-java-desktop-application-to-netbeans-7-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!