Have a look at the frame methodsetResizable(boolean resizable)so your code should befeame.setResizable(false);