need help with resolution

i am working on an application that has to be deployed... however, i have been working in the resolution 1280 x 800, while the deployment might take place on a computer with any resolution. it is even possible that the computer on which the deployment is done might not have this resolution. when this application was used on a computer with a different resolution, everything looked a mess.

so my question is: what to do to make an application compatible with any resolution?

[489 byte] By [m_kadiaa] at [2007-11-27 1:43:51]
# 1

public Point getScrrenResolution(){

Point p = new Point();

DisplayMode displayMode = null;

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();

GraphicsDevice[] gs = ge.getScreenDevices();

for (int j = 0; j < gs.length; j++) {

displayMode=gs[j].getDisplayMode();

}

if (displayMode!=null)

p.setLocation(displayMode.getHeight(),displayMode.getWidth());

return p;

}

J@A@V@Aa at 2007-7-12 1:02:16 > top of Java-index,Java Essentials,Java Programming...
# 2
thanks buddy for such a quick reply. ok, so this will help me get the screen resolution. but what do i do with it? i'm utterly clueless
m_kadiaa at 2007-7-12 1:02:16 > top of Java-index,Java Essentials,Java Programming...
# 3
You can set the Height and Width of your visual components depending on the screen resolution.
J@A@V@Aa at 2007-7-12 1:02:16 > top of Java-index,Java Essentials,Java Programming...
# 4
Or just use a proper layout manager?
-Kayaman-a at 2007-7-12 1:02:16 > top of Java-index,Java Essentials,Java Programming...
# 5
A proper Layout Manager is a mustI was spaecking about the situation when you have a resolution of 800x600 and your frame is 1024x768...
J@A@V@Aa at 2007-7-12 1:02:16 > top of Java-index,Java Essentials,Java Programming...
# 6

well yes that is true. however, in once case, i need to draw on a label, and that needs to have a specific size that cannot be handled by the layout manager... i tried every layout other than gridbag. it didn't give the results that i wanted. gridbag layout is very confusing, so i try to avoid it. m i making a mistake?

m_kadiaa at 2007-7-12 1:02:16 > top of Java-index,Java Essentials,Java Programming...
# 7
The LayoutManager cannot handle or YOU DON'T WANT that the LayoutManager handle that JLabel.Didi you use SPringLayout?It gives you moer liberty.
J@A@V@Aa at 2007-7-12 1:02:16 > top of Java-index,Java Essentials,Java Programming...
# 8
no i meant that the layout managers i used either made the JLabel too big or too small. but no i haven't used springLayout. will do so and let you know. thanks
m_kadiaa at 2007-7-12 1:02:16 > top of Java-index,Java Essentials,Java Programming...