list
logo

Application is not fullscreen after start

Expected Behavior

Application starts fullscreen

Actual Behavior

Application starts in a window and user must to click maximize to go fullscreen.

Solution

Swing

To start your app in Fullscreen use:

frame.setExtendedState(Frame.MAXIMIZED_BOTH);
frame.setUndecorated(true);  
This will take the height and width from the div

Netbeans

Netbeans app, create 2 classes to remove the windows decoration:

public class Clazz extends ModuleInstall {

    public void restore() {
        WindowManager.getDefault().getMainWindow().setExtendedState(Frame.MAXIMIZED_BOTH);
        WindowManager.getDefault().getMainWindow().setUndecorated(true); 
    }

}
@OnShowing
public class Fullscreen implements Runnable {

    public void run() {
        WindowManager.getDefault().getMainWindow().setSize(Integer.parseInt(System.getProperty(webswing.screenWidth)),Integer.parseInt(System.getProperty(webswing.screenHeight))); 
        WindowManager.getDefault().getMainWindow().setExtendedState(Frame.MAXIMIZED_BOTH);
    }

}