While using JFrame, is it开发者_Go百科 possible to have the window unable to be expanded by the user?
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);
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);
精彩评论