views:

698

answers:

2

This is driving me crazy. When I set an appropriate size for my window in design-mode it just ignores this size and uses something else when I compile and run. Even tough I set the minimumSize and preferredSize it just ignores this... Why? How can I set my own size?

+1  A: 

Have you checked if you really set the size of the JFrame or of a contained JPanel?

Have you tried setSize?

Peter Lang
+3  A: 

Even if you've set the size with minimumSize, preferredSize, you might have forgotten to call pack() in which Swing will resize the components (and all of it's subcomponents) according to the sizes set.

Spoike