I am porting my desktop Swing application to an applet. The following code works perfect for JFrame
entity to set a maximum available window size, considering a task bar.
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
Rectangle bounds = env.getMaximumWindowBounds();
frame.setMaximizedBounds(bounds);
frame.setPreferredSize(bounds.getSize());
frame.setLocation(0, 0);
In Eclipse Run Configurations -> My Applet -> Parameters I can select Width and Height or if applet is run from browser one would have to do:
<applet code="myJApplet" width="800" height="480">
But I would like to be able to set size dynamically depending on screen resolution. How would it be possible?