File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Problem of different monitor/screen size for GUI application. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem of different monitor/screen size for GUI application." Watch "Problem of different monitor/screen size for GUI application." New topic
Author

Problem of different monitor/screen size for GUI application.

chets patel
Ranch Hand

Joined: Apr 27, 2010
Posts: 77

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
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

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.


Mohamed Sanaulla | My Blog
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 561
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.


Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2191
    
    7
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
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

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
 
GeeCON Prague 2014
 
subject: Problem of different monitor/screen size for GUI application.