2

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.

mKorbel
  • 109,525
  • 20
  • 134
  • 319

1 Answers1

3

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.

Josh Marinacci
  • 1,715
  • 1
  • 14
  • 15
  • Many thanks Josh. I have another application that we lost the GUI forms from when we ported to JBuilder many years ago - we still maintain it but it is a real pain and I don't really want another one like that. This morning I have found tool called JFormDesigner that is a Netbeans plugin (and standalone) that seems to allow me to edit the form. I am using the evaluation and will see how it goes. If I was to write it again now would I use Java FX? – Dave Masters Jun 20 '12 at 05:11
  • Hard call - depends on the app Dave. IMO, if writing an app from scratch, for many cases write the new app in JavaFX. Unless you embed JFXPanels piecemeal, switching from Swing to JavaFX is more of a rewrite than a port - especially if the layout and styling is to be done using fxml and css. An additional difficulty when creating large JavaFX applications is, as yet, nobody has created a complete, pure JavaFX Application Framework- so you will either need to build bits yourself or embed in an existing non-JavaFX framework like NetBeans or Eclipse. – jewelsea Jun 20 '12 at 18:18