Have you tried using the setMinimumSize(Dimension) frame?
frame.setMinimumSize(new Dimension(100, 100));
A look at the documentation tells me that the behavior you see is platform dependent, so if you have multiple platforms, it might be a good idea to check the code that you have on each of them; which ones work and which don't.
The following code example works for me as desired in Windows Vista:
import javax.swing.JFrame; import java.awt.Dimension; public class Ex extends JFrame { public static void main(String[] args) { JFrame frame = new JFrame("YOU CAN'T SHRINK ME COMPLETELY!"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400, 400); frame.setMinimumSize(new Dimension(100, 100)); frame.setVisible(true); } }
source share