Frame class provides a method named setResizable() that takes a boolean argument. If the argument is true, the frame can be resized by the user. This is the default behavior. If the argument for setResizable() is false, the frame cannot be resized.

Java Code:
frame.setResizable(false);