Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem of different monitor/screen size for GUI application.  RSS feed

 
chets patel
Ranch Hand
Posts: 77
Eclipse IDE Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am creating GUI application in swing. different users have different screen size. I can get the screen size using


But how can I set different components of swing in jframe as size varies with every user.
Please explain.
 
Mohamed Sanaulla
Bartender
Posts: 3169
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can specify the size and layout of different components based on the Dimensions you get for the Screen/Based on the JFrame's dimensions.
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you planning to vary the size of the JFrame with the size of the user's screen?

In my limited experience, if I set the size of the JFrame, optimize my component layout for that size, and then set the JFrame to not change sizes, my layout stays OK. I've had minor problems with different screen resolutions, but those have been manageable. I've also noticed that others managing large frames that might grow initiate them at (0, 0) to have the maximum screen real estate available for growth.

These approaches may not suit your requirements, so please explain what you're trying to do.
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But how can I set different components of swing in jframe as size varies with every user.


You let the layout manager worry about this.

Read the section from the Swing tutorial on Layout out Component in a Container.
 
Mohamed Sanaulla
Bartender
Posts: 3169
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:
But how can I set different components of swing in jframe as size varies with every user.


You let the layout manager worry about this.

Read the section from the Swing tutorial on Layout out Component in a Container.

Oh yeah, this one is a better option. Didn't come to my mind
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!