null layout

P

patrick

Ive made a java application JFrame with several JPanels and a few
components.
All the layouts I have set to null.
the frame size ive set: setSize(new Dimension(790, 575));

This displays on my screen when it is run as 8.6 inches by 6.25 inches
approx.

When I change the screen resolution from 1024 by 768 to higher resolutions
and run it again it still
displays as 8.6 inches by 6.25 inches.

I dont understand that. With null layout I expect it to be less than 8.6
inches width

why does it not shrink in size when I increase the screen resolution?


thanks
patrick
 
A

ak

with setLayout you can't change size of (J)Frame, only JPanels inside.

code snippet could be helpful.
 
M

Michael Holtermann

Am Sun, 30 Nov 2003 19:15:06 +0100 schrieb ak:
with setLayout you can't change size of (J)Frame, only JPanels inside.

With setLayout you wan't set any sizes by pixels, but I guess the OP sets
the size by JFrame#setSize(int, int).

This should be the last call before JFrame#show(), definitely after
JFrame#pack(). pack() would recall the preferred sizes of the inlaying
components and resizes the window. See java.awt.Window#pack() for details.

HTH, Michael.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top