Netbeans 7.1 dropped Swing Application Framework support? How can I migrate form 7.0 to 7.1?
Asked Answered
D

4

6

Last week, I get very depressed, I have three big apps in production and many more using Swing Application Framework. Later, when I started to migrate to Netbeans 7.1, BOOM!, no more support for SAF.

So what can I do, any ideas how to migrate to Netbeans 7.1?

I will appreciate your help.

PS: Netbeans team, please don't add frameworks without a warning that are just an Java Specification Request - JSR. When I started to use SAF, it looks like it will be never discontinued.

PS2: To make us hear we are using SAF, vote at https://netbeans.org/bugzilla/show_bug.cgi?id=204661

Depicture answered 23/2, 2012 at 16:39 Comment(2)
the work is continued in BSAf (better-swing-application-framework), it's a project on kenai (don't know about the ease to re-integrate it on Netbeans, though)Joachim
it looks as if they are doing this to encourage/push users to switch to the rich JavaFX 2.0 platform. So far support of JavaFX 2.0 is yet to pick up pace and its still in its early stages.Irs
B
2

I don't have a good answer, but this may give other people more ideas (and it would be more useful to include the info here than to post a separate question)...

I also have a SAF app that I now need java 1.7 for, so have switched to netbeans 7.1, and can't edit the forms in nb7.0. I switch between nb7.0 to edit screens, then use nb7.1 to compile and run.

If I create a form in nb7.1, it works ok with my app, and I've looked at the generated code and the .properties files nb7.0 and nb7.1 create for, say, a JPanel, they look identical.

I haven't figured out how to "convert" the nb7.0-generated JPanels to ones that work with nb7.1, but I can create an empty JPanel in 7.1, then run 7.0 and copy all the controls from the 7.0 form to the 7.1 form. Icons get lost--a NetBeans bug, and code gets lost, in general, a costly and error-prone process.

There may be some flag somewhere in the project that tells if a JPanel is "SAF" or not. If so, finding it would make migration much easier.

Burbage answered 24/5, 2012 at 23:40 Comment(1)
Some plugins have been added that may help, see netbeans.org/bugzilla/show_bug.cgi?id=204661#c59Burbage
B
4

I found SAF as a plugin for newer NetBeans: http://plugins.netbeans.org/plugin/43853/swing-application-framework-support

Bunyabunya answered 25/10, 2012 at 12:29 Comment(2)
This is a build from the old SAF sources, not from BSAF, so we have postponed the problem but not solved it; also note that the plugin is in NOGO status, because it doesn't show up in the plugin manager.Pagurian
It's not working, i don't recommend it for 7.2 version.Corroboree
B
2

I don't have a good answer, but this may give other people more ideas (and it would be more useful to include the info here than to post a separate question)...

I also have a SAF app that I now need java 1.7 for, so have switched to netbeans 7.1, and can't edit the forms in nb7.0. I switch between nb7.0 to edit screens, then use nb7.1 to compile and run.

If I create a form in nb7.1, it works ok with my app, and I've looked at the generated code and the .properties files nb7.0 and nb7.1 create for, say, a JPanel, they look identical.

I haven't figured out how to "convert" the nb7.0-generated JPanels to ones that work with nb7.1, but I can create an empty JPanel in 7.1, then run 7.0 and copy all the controls from the 7.0 form to the 7.1 form. Icons get lost--a NetBeans bug, and code gets lost, in general, a costly and error-prone process.

There may be some flag somewhere in the project that tells if a JPanel is "SAF" or not. If so, finding it would make migration much easier.

Burbage answered 24/5, 2012 at 23:40 Comment(1)
Some plugins have been added that may help, see netbeans.org/bugzilla/show_bug.cgi?id=204661#c59Burbage
M
1

I have succeeded in opening SAF form in Netbeans 7.2. after using some of tips from the forum: http://forums.netbeans.org/topic43775-0-asc-30.html:

  1. Delete comments // <editor-fold defaultstate="collapsed" desc="Generated Code"> arround initComponents() in the code of your form
  2. Get rid of all @Action annotations - instead use componentObject.addActionListener() or similar
  3. Get rid of all org.jdesktop.application and ...getActionMap()
  4. From .form file delete all tags starting with <Property name="action" type="javax.swing.Action".

I don't guarantee that in your case it will make your form work in 100%, but for me it worked - my form could be opened in Netbeans 7.2.

If Netbeans displays you some errors or warnings, read those messages and try to find out what's wrong - maybe you have for example deleted too much.

Marozas answered 10/4, 2013 at 12:12 Comment(0)
C
1

The instructions from the guy who managed to port a SAF form into Netbeans 7.2 got me started. There is more to it porting into Netbeans 7.3. I recommend starting with a simple form with nothing in it created in Netbeans 6.9 then make the same form in 7.3 and compare the .java and .form code that is generated. That will show you all the differences that have to deal with porting the form. Once you get a simple form in try doing the same adding in an example of the component types you use like tabbed panes, buttons, check boxes, etc. Once again do a file compare so you can see how each component type is different. Every component type in SAF forms contains some kind of text property resource abstraction linked to a line in the properties file for the class and you have to break that link and just put an actually value in the Netbeans 7.3 Form. If you miss a single resource related parameter in the form then you will get that same error message until you have fixed everything. I managed to go through that exercise for an extremely complex frame and it took me a couple solid days partially learning curve. Only 15 more Frames to do most fairly complex but not as much as the main view which I did first.

Corycorybant answered 26/1, 2014 at 23:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.