This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I've just downloaded and installed netbeans 7.2.1 and tried to continue a project I was working on, I opened a form class in the IDE and tried to edit the Design, when I clicked on the design button a dialog box appears informing me that swing is no longer supported, and the design view won't open.
is there a way to convert the swing elements into whatever the replacement for swing is ?
The Swing Application Framework (SAF) support has been discontinued in NetBeans 7.1, because JSR 296 has been withdrawn. SAF is not the same thing a Swing, though. I don't think NetBeans offers any clear cut way of porting to an alternative for SAF. You could stick with an older version of NetBeans (< 7.1) or bite the bullet and switch to something entirely different like Eclipse RCP, which is based on SWT instead of Swing.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Jelle Klap wrote:I don't think NetBeans offers any clear cut way of porting to an alternative for SAF.
They do. NetBeans does offer an alternative which is called as NetBeans Platform or NetBeans RCP. They recommend now to build a Platform app instead of SAF.
In fact, this is mentioned in the link provided by Kemal (6th question).
I don't know much about Eclipse RCP, but NetBeans RCP is built on top of Swing, so, it would be much easier to port an existing Swing application.
What options are there for developing with Swing Application Framework?
Developers who still want to use the Swing Application Framework functionality in the IDE can do so with NetBeans IDE 7.0.1 or earlier versions of the IDE.
NetBeans RCP sounds more like an alternative for new development than a way of porting existing applications.
Is there an alternative to Swing Application Framework in developing Java desktop applications in NetBeans 7.1?
You can use NetBeans Platform in NetBeans 7.1. It provides many more features, including a plugin system and a docking framework, than the Swing Application Framework did.
As for porting, any application for that matter, porting is not easy. But, NetBeans RCP is specifically mentioned for example in this porting page and this dzone page. The dzone page (by Geertjan) specifically talks about the discontinuation of SAF and says moving to NetBeans RCP is the logical step. The porting page link is actually provided in the bottom of the SAFSupport page.
Thanks for the advice, I must say I am extremely displeased with netbeans, as quite a novice at this, I relied on the visual interface, especially since the tutorials promoted it so much. Now to just remove it without any warning is disgraceful.
having found swing very frustrating to code and get the end results I wanted the visual UI was a god-send.
I have tried the tutorial of Netbeans porting, its fine until I get to the Porting level 0: Launchable. part 4. I get errors for @ActionRegistration no key available and for the @Messages. not knowing what to do now I have given up. I have re-installed 6.9.1. and now I am seriously thinking of changing to Visual Studio or Delphi/Rad. I don't want to be in a position in a couple of years time where they decide to rip other functionallity from Netbeans on a whim.
I use NetBeans a for most of my Java development, and I used SAF for most of my desktop Apps.
I really don't see the NetBeans Platform as a natural path for SAF apps. It's sort of like buying a school bus to replace a GEO Metro. Yes they both will get you to the same place but the cost per mile and ease of parking are quite a bit different.
SAF is a lightweight, small foot print way of controlling simple application while NB RCP is neither small footprint nor simple.
That's the bad news. The good news is that I didn't really use SAF for much. NB can still be used to design JFrame and jDialog classes that do what I want. Add in a little hand written code to open the main Frame and I end up with a simple and lightweight GUI. I haven't needed to learn the NB RCP, yet but perhaps I will someday.
I think it's unfair to blame the NetBeans project for the decision to discontinue support for SAF. That was the Java group. NetBeans made the right decision to no longer support a technology whose upstream provider is not longer support it.
I do agree it's a shame to take away something that simple and easy to use.
It's not what your program can do, it's what your users do with the program.
Yves Somme wrote:having found swing very frustrating to code and get the end results I wanted the visual UI was a god-send.
I was in somewhat similar situation when I started with Java. I needed to get coding quick. But over the time I begun to dislike the visual designer and ultimately rewritten all forms "by hand". Hand written code is much more readable and far less bloated, in my opinion.
Meanwhile, you might want to have a look at this tool: http://sourceforge.net/projects/nosaf/. Looks like it was designed to convert a SAF application to regular Swing one. As I haven't used SAF at all, I'm unable to offer any experience with that tool, though.
now I am seriously thinking of changing to Visual Studio or Delphi/Rad.
I'm not really sure that would be necessarily for the better. I've encountered something very similar with our VB6 applications Plus, there are many other good Java IDEs around.
I agree with what Joe says. The SAF JSR died and its unfair to blame NetBeans for that. I was also disappointed with the discontinuation of SAF support in NB, but maybe they didn't want someone to come back later and yell at them, like, "why did you support something that is not going to be a standard?".
Martin Vajsar wrote:Hand written code is much more readable and far less bloated, in my opinion.
That happens when we use the "default" layout that NB has (which is GroupLayout).
What I do is, I still use my favorite layouts like Flow, Border and GBL with the designer (along with nested panels) and in that case, the code is less bloated.
Martin Vajsar wrote:Plus, there are many other good Java IDEs around.
Actually, NB is a very good IDE and we can still hand-code Swing applications with NB. In that case, it would be just another Java application. But, the visual designer is heavily promoted (even in Oracle tutorials), so, most people start with that.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com