• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Problem of different monitor/screen size for GUI application.

 
Ranch Hand
Posts: 77
Eclipse IDE Tomcat Server Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 3324
32
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic