I would like to open my application in netBeans in the fullscreen mode when running it.
I have tried many things. Lastly, I have tried to put following code to the "Customize code" option when clicked on PrefferedSize in the properties of the main JFrame:
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
Unfortunately, it doesnt work. Any ideas? Thanks.
By "fullscreen" do you mean "maximized"? If so, then try this:
myFrame.setExtendedState(myFrame.getExtendedState() | JFrame.MAXIMIZED_BOTH);
You don't say what OS you're using, but if you're using Windows and you find your taskbar is covered by the maximized frame call this beforehand:
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();