Question: I'm having a problem, creating a fixed-size overall panel for a touchscreen GUI application that has to take up the entire screen. In a nutshell, the touchscreen is 800 x 600 pixels, and therefore I want the main GUI panel to be that size.

When I start a new GUI project in NetBeans, I set the properties of the main panel for min/max/preferred size to 800 x 600, and the panel within the 'Design' view changes size. However, when I launch the app, it is resized to the original default size.

Adding this code after initComponents() does not help:

```
this.mainPanel.setSize(new Dimension(800,600));
this.mainPanel.setMaximumSize(new Dimension(800,600));
this.mainPanel.setMinimumSize(new Dimension(800,600));
this.mainPanel.repaint();

```

I've peeked into all of the resource files and cannot seem to find values that would override these (which seems somewhat impossible anyway, given that I'm setting them after initComponents() does its work). I'm using the FreeDesign layout, because I wanted complete control over where I put things.

I suspect the layout manager is resizing things based upon how many widgets I have on the screen, because different prototyped screens come in at differing sizes. 

Help is appreciated!

Answer: 
Have you tried [java full screen mode](http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html)?
I'm not sure how your touchscreen device works. But if you use Netbeans preview your panel is put in some outer container like JFrame/JWindow. And just maybe you set the frame to 800x600.

If so, then the problem might be that the frame eats a few pixels for its own border, leaving your panel size < 800x600. And in that case your panel will be unable to use your min/max settings and revert to default sizes.