aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes The end of Swing what now? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "The end of Swing what now?" Watch "The end of Swing what now?" New topic
Author

The end of Swing what now?

Yves Somme
Greenhorn

Joined: Apr 30, 2012
Posts: 6
Hi

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 ?
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

Read SAFSupport for more details on the issue you're having, and to also get to know the difference between Swing and Swing Application Framework.

is there a way to convert the swing elements into whatever the replacement for swing is ?

This issue does not affect Swing library, that is still part of Java, so no need to look for "the replacement for Swing".


The quieter you are, the more you are able to hear.
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1836
    
    7

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.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1096
    
  10

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.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1836
    
    7

Actually what I can tell from that page is:

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.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1096
    
  10

In the page, the last question mentions this:
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.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

Yet another reason, why the use of the DnD style "designers" should be discontinued. Hand coding is the best.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Yves Somme
Greenhorn

Joined: Apr 30, 2012
Posts: 6
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.
Joe Areeda
Ranch Hand

Joined: Apr 15, 2011
Posts: 318
    
    2

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.

Joe


It's not what your program can do, it's what your users do with the program.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3611
    
  60

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.

Reading the Swing tutorial has helped me a lot.

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.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1096
    
  10

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.
 
wood burning stoves
 
subject: The end of Swing what now?