Mit ‘Applet’ getaggte Beiträge

I’m playing around with the Features of the latest Java Plugin for Browsers.
I just can say, you should really use the JavaScript one, to create Applet- or Webstart-Tags.

Due this new features I decided to deploy my applet with Java Webstart and created a JNLP file. Works like a charm.

But after I started my applet in Standalone Mode with my created Desktop-Icon, I couldn’t resize my applications. Normally you would call the Methode „setResizable“, but JApplet doesn’t provide one.

So here is the Solution I found for this problem without developing an Extra Class to launch my Applet as an Application.

Solution -> extend the JApplet.init() Method:

Window window = SwingUtilities.windowForComponent(this);
if (window instanceof JFrame){
JFrame frame = (JFrame)window;
if (!frame.isResizable()){
frame.setResizable(true);
}
}

Advertisements