Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2008

Tip: Looking for answers? Try searching our database.

Lockable JFrames?

Thread view: 
Zerex71 - 29 Apr 2008 15:20 GMT
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
Matt Humphrey - 29 Apr 2008 15:48 GMT
> Greetings,
>
[quoted text clipped - 3 lines]
> stay a fixed size.  I have looked through all the documentation and
> the set*Size() methods don't seem to do it for me.

frame.setResizable(false)

Matt Humphrey http://www.iviz.com/
Zerex71 - 29 Apr 2008 16:04 GMT
> > Greetings,
>
[quoted text clipped - 7 lines]
>
> Matt Humphreyhttp://www.iviz.com/

Thank you!  I did not spot that in any of the methods in the
inheritance tree in the API documentation.

Mike
Chase Preuninger - 30 Apr 2008 02:27 GMT
myFrame.setResizable(false);

What I want to know, is there a way to set a max/min size for a frame?
RedGrittyBrick - 30 Apr 2008 10:01 GMT
> 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.

Signature

RGB

Zerex71 - 30 Apr 2008 15:25 GMT
On Apr 29, 9:27 pm, Chase Preuninger <chasepreunin...@gmail.com>
wrote:
> 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).


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.