0
votes

I have this code :

if(false) 
    {

        this.setUndecorated(true);

        this.setExtendedState(this.MAXIMIZED_BOTH);
    }
    else 
    {

        this.setSize(1024, 768);

        this.setLocationRelativeTo(null);

        this.setResizable(false);
    }

My app runs in a window mode but when i change the false statement to true, it runs in Full screen mode.

I don't get what represent the false statement in If?

Thank you for your time

1
It will never go in if block. Why you are doing in this way? What you want to achieve? - Braj
Don't set the size because it will not work on another resolution or system. - Braj

1 Answers

1
votes

I don't get what represent the false statement in If?

There is no meaning of this type of condition because it creates a Dead code it means it will never be reached at all.

Don't use set size to full screen the window because it will not work on different resolution and system.

how it will look on resolution below [1024 X 768]?

this.setExtendedState(this.MAXIMIZED_BOTH); is a good approach to full screen it.