You can set a JFrame as not resizable and set its size explicity.
JFrame window = new JFrame();
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setSize(600, 400);
window.setResizable(false);
window.setVisible(true):
This also works with an AWT Frame:
Frame window = new Frame();
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.setSize(600, 400);
frame.setResizable(false);
frame.setVisible(true);