On Mon, 8 Mar 1999, Kevin White wrote:
> I have a frame in which I would like to use no layout manager so that I
> can directly position elements where I want them.
> 
> I use the following code, in the constructor of a class that descends
> from Frame:
> 
> setSize(600,380);
> setLayout(null);
> Label label=new Label("Hi there");
> label.setBounds(10,10,200,20);
> add(label);
> 
> Is there anything wrong with this?  This is what I do on other platforms
> and works fine.  However, unless I use a layout manager, I cannot see
> this label show up on the window.

On which platforms does it work fine?

I don't think there is anything wrong with this.  I just tried it
on the pre-release of JDK1.2, using a remote X server, and I
noticed the label briefly appear and then disappear (which may
happen too fast to be noticeable on a local X server), so I think
this is probably a bug in the Motif AWT peers on Linux.

I also tried it using my prototype GTK AWT peers, and the
label did appear (although I don't think it was in quite the
right place, so I also have a bug).

Nigel Gamble                                    [EMAIL PROTECTED]
Mountain View, CA, USA.                         http://www.nrg.org/


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to