Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Resize does not force layout

2 views
Skip to first unread message

A. Bolmarcich

unread,
Sep 19, 2001, 10:22:01 AM9/19/01
to
In article <9oa3aj$1632$1...@news.net.uni-c.dk>, Bo...@leonhardresearch.dk wrote:
> When I resize a JFrame (or a JDialog) using setBounds, those frames are
> not laid out. Even calling doLayout() doesn't work. Nothing really happens
> until I click the border of the Frame with the mouse. Maybe I've
> misunderstood something, but I thought layout was called whenever
> properties like size and location changed ...

The doLayout() method layouts the components in the container on
which it is invoked. You want to invoke validate() after setBounds.
The validate() method layouts the components in the container and
recursively layouts those components that are containers.

0 new messages