With fixed/enhanced applets in JDK 6 u10 and Web Start support in java project in NB 6.5 it would be nice to also
provide applet-based application using the Swing Application Framework.
In NetBeans the main technical blocker is that a project cannot be run as an applet - see issue 139867. It would be
silly to generate an application that cannot be run then. There is a workaround possible using Web Start, but that would
be strange to be used by default (anyway there's also issue 139865 which prevents it now).
In Swing Application Framework itself the problem is that it does not support applet-based applications yet. It is
technically possible to hack around it - make an applet be the class to start from which the application is launched in
its init method. (Separate Application subclass can be created which does nothing in its startup method.) The applet
itself is then also used as the main visual class designed in the GUI builder. This approach works, but has some cons
(besides the mentioned blockers):
- The setup is just a workaround for missing feature in SAF, not a good practice to promote.
- GUI builder fails showing menu (menu designer bug in applets).
This could perhaps work if we provided a very simple template bringing just an empty applet in which the user can use
the SAF features.
More elaborated template could be provided once applets are supported in SAF directly. Then also need to design the
template itself - how it should look like. Should an applet have menu bar and status bar just like the frame
application? Should it also support databases?
I agree this feature would be useful. Another part of the applet development workflow is a way to use applets in web
pages - I filed a separate issue 144037 for this.
Re support for databases - I must say I don't think this would be very useful. When an applet tries to connect to a
database on the server, it often needs to go through a firewall, and protocols used by JDBC drivers typically do not
pass through firewalls. Also, websites will not want to expose databases in front of the firewall as that would make
them vulnerable, databases are typically hidden behind a firewall and exposed through a server-side application. So, I
think REST web services is a better way to connect to backend data residing on the server.
(Well, unless you are talking about embedded Java databases such as Derby which run inside the applet for which there
may be *some* use cases, though in most cases server-side storage will be needed, which an embedded database can not
See also a related issue 142386.
*** Issue 49630 has been marked as a duplicate of this issue. ***
NetBeans support of Swing Application Framework has been discontinued => closing this issue as WONTFIX.