• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

The end of Swing what now?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Bartender
Posts: 825
5
Python Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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".
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yet another reason, why the use of the DnD style "designers" should be discontinued. Hand coding is the best.
 
Yves Somme
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic