Title: RE: Designing Swing Applications for different resolutions with null layouts

Here's one minor twist that may help.

Continue to use NullLayout but use an actual linear measurement
for placement rather than pixels -- which of course vary by screen resolution.

I.e. do your placement in inches or points.
You can get the conversion factor from Toolkit:

/**
 * convert inches to pixels
 **/
public static int inches(double inches)
{
    return (int) (inches * Toolkit.getDefaultToolkit().getScreenResolution());
}

/**
 * convert points to pixels
 **/
public static int points(int points)
{
    return inches(points / 72.0);
}

Regardless of the layout manager chosen, doing critical positioning
by pixels is always problematic.

HTH
~rmp

Ralph M. Prescott
Technical Lead / Solutions Development
Xelus, Inc.

web:   http://www.xelus.com
email: [EMAIL PROTECTED]
vmail: 585.419.3137
im:     rmprescott@yahoo

Reply via email to