Reputation: 870
While using JFrame, is it possible to have the window unable to be expanded by the user?
Upvotes: 3
Views: 408
Reputation: 72079
You just need call setResizable(false)
on your JFrame
, e.g.:
JFrame frame = new JFrame();
frame.setSize(500, 300);
frame.setResizable(false);
frame.setVisible(true);
Upvotes: 5
Reputation: 6536
This is what you want. It explains it setResizable() method.
EDIT: If you would like a quick introduction, say your JFrame object is called myFrame
, then, to make it non-resizable,
myFrame.setResizable(false);
Upvotes: 8