Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make a frame not resizeable ?

 
Varaku Venkata
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can somebody tell me how to make a frame not resizeable ?
Thanks
 
Geir Morten Hagen
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setResizable(false)
Why would you prevent the user from resizing the frame?
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setResizable(false)? Or am I missing something?
- Peter
 
Varaku Venkata
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Geir ...I want to make the frame size to be one particular size..i will set an initial size to the frame and in that i will place the components ...i do not want the user to maximize it so that the placing of the components is disturbed.....
in which class is this method setResizeable(false) present..
Thanks Geir for replying so fast...
 
Geir Morten Hagen
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would not do that. What if the user like to have his applications maximized?
The use of layout managers will help
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in which class is this method setResizeable(false) present..

java.awt.Frame, which is a superclass of JFrame.
Mark
 
Rajesh Matti
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Geir- Using layout will not stop anybody from making a screen look bad. Even if you use GridBagLayout, if you have not set the constraints right, screen can still loook bad, if the user resizes. Hence once may need to make a screen not resizable, if he/she thinks it may worsen the look and feel.
-Rajesh
 
Varaku Venkata
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rajesh,
I am also in sync with your opinion.......but is it correct or is there anybody who have made the frame(having some LayoutManager) not resizeable...
Thanks
venkat
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would go with 640x480 for the JFrame and not worry about putting any limitations on the user.
 
Rajesh Matti
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Varaku - I would maximize the screen by setting its dimension to toolkit.getScreenSize(). But let the user resize the screen.
-Rajesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic