How to set a default frame size?

  5 posts   Feedicon  
Replies: 4 - Last Post: June 04, 2011 06:06
by: jhirzel
showing 1 - 5 of 5
 
Posted: October 14, 2010 13:33 by tburk
Hi to all,

I'm using BSAF SessionStorage to persist UI properties. However on the very first start of my application (no session.xml file is available), the frame size is not as I want it to be. How can I set a default frame size?

Thanks
 
Posted: October 15, 2010 00:25 by cpudney
G'day,

I'm using BSAF SessionStorage to persist UI properties. However on the very first start of my application (no session.xml file is available), the frame size is not as I want it to be. How can I set a default frame size?


I've come across this too.

My solution is to set the frame's preferredSize. Thus, on the first invocation the frame has the preferredSize, and on subsequent invocations the persisted dimensions are used.

Regards,
Chris.
 
Posted: October 15, 2010 07:32 by tburk
Thanks, Chris. The solution is working.
@etf: Shouldn't the framework provide a fallback to default layout settings if no session is available?

Regards, Timothy
 
Posted: October 16, 2010 09:53 by etf
If no session exists the framework use settings from the JFrame. If size of the widow is not too big to fit into the actual screen and particular position is not set the window is show centered.
 
Posted: June 04, 2011 06:06 by jhirzel
Do you mean something like this

this.getMainFrame().setPreferredSize(new Dimension(800,600));


J.
Replies: 4 - Last Post: June 04, 2011 06:06
by: jhirzel
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close