Lockable JFrames?

Z

Zerex71

Greetings,

I was wondering if there was a way to "lock" a JFrame to a certain
size to prevent user resize attempts. It won't kill me not to have it
but I would like to keep a JFrame (containing a drawing canvas) to
stay a fixed size. I have looked through all the documentation and
the set*Size() methods don't seem to do it for me.

Thanks,
Mike
 
C

Chase Preuninger

myFrame.setResizable(false);

What I want to know, is there a way to set a max/min size for a frame?
 
R

RedGrittyBrick

Chase said:
myFrame.setResizable(false);

What I want to know, is there a way to set a max/min size for a frame?

AFAIK the best you can do is catch resizing events and if the new size
is outside your bounds, resize the frame to bring it back within bounds.
This looks a bit odd to the user.
 
Z

Zerex71

myFrame.setResizable(false);

What I want to know, is there a way to set a max/min size for a frame?

You could try setMinimumSize(Dimension) and setMaximumSize(Dimension).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top