The Artima Developer Community
Sponsored Link

Java Answers Forum
Keeping layout in synch with screen resolution

1 reply on 1 page. Most recent reply: Dec 9, 2004 4:19 AM by GAURI

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Gibran Shah

Posts: 27
Nickname: gibby
Registered: Jun, 2004

Keeping layout in synch with screen resolution Posted: Nov 5, 2004 10:10 AM
Reply to this message Reply
Advertisement
I just discovered a problem with my GUI application: The layout of my JFrames are disproportional across different screen resolutions. That is, on my laptop where I'm developping my program, I've layed out all components of my interfaces nicely so that they are all visible within the JFrame based on the width and hight of the JFrame. However, just a moment ago, I transferred my program to another computer, recompiled and ran it, and found that a lot of components in a lot of my interfaces have been pushed passed the right and bottom edges of the JFrames. For example, I have some Accept and Cancel buttons on the bottoms of some JFrames which are no longer visible because their X and Y coordinates surpass the boundaries of the JFrame itself. Note that I'm not saying that it's extending passed the edge of the screen, which means that it would seem that the JFrame sizes itself differently than its components. That is, where the size of the JFrame seems to depend on some kind of Windows/Desktop pixel-size system, the JFrame's components seem to depend on some kind of Swing pixel-size system. How can I tell the JFrame to size itself according to the current resolution?

Keep in mind, I'm using a null LayoutManager. I'd prefer to keep it this way since I like having full control over where I place my components.

Gib


GAURI

Posts: 2
Nickname: gauri
Registered: Dec, 2004

Re: Keeping layout in synch with screen resolution Posted: Dec 9, 2004 4:19 AM
Reply to this message Reply
Hello Gib,
while developing a GUI always keep Low Resolution. and while copying your program to other system alway check the resolution of that System. If resolution matches then no problem. Other wise change the resolution as per your requirement.
Other wise write a code which will automatically check the resolution and set as required.
Gauri

Flat View: This topic has 1 reply on 1 page
Topic: why is Object the root class Previous Topic   Next Topic Topic: thread pooling in java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use