How to keep window size unchangable?

I am workong on a program, which requires the window size unchangable.Althougth I have paid great efforts to solve this problem, no use. So i am here asking for help!
[187 byte] By [HeadNiejing] at [2007-9-30 20:33:37]
# 1
are you using a JFrame? JWindow?
mcatz at 2007-7-7 1:23:07 > top of Java-index,Desktop,Core GUI APIs...
# 2

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):

jdmiller at 2007-7-7 1:23:07 > top of Java-index,Desktop,Core GUI APIs...
# 3

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);

jdmiller at 2007-7-7 1:23:07 > top of Java-index,Desktop,Core GUI APIs...