Eric Sauer
Eric Sauer

Reputation: 870

Unexpandable Window

While using JFrame, is it possible to have the window unable to be expanded by the user?

Upvotes: 3

Views: 408

Answers (2)

WhiteFang34
WhiteFang34

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

Dhaivat Pandya
Dhaivat Pandya

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

Related Questions