Nelson Minar wrote:

> >i was wondering if it is possible to set the position of
> >a java GUI once it starts up. Whenever i run a application
> >it starts up in the corner of the screen.
>
> Like people said, setLocation() will do that. But I have a related
> question - how do I *not* set the position of a window? I don't call
> any methods to set the position, yet my window manager thinks the
> window is demanding to be placed at 0,0. I'd rather let the window
> manager decide itself.
>
> Am I doing something wrong here? Is this a (small) JDK bug for X?

It may be in the spec but Java defaults to (0,0) if the bounds are not set.
It happens in the java layer by default I'm pretty sure.
If you want placemnt you will have to roll your own.

Btw calling setBounds befor setVisible  keeps the winow from showing at 0,0
before moving to Location.
I think setLocation only works afte your visible

Call
frame.pack();
Dimension d = getSize();
int myX= ??
int myY= ??
setBounds( myX,myY,d.width,d.height);
setVisible(true);

Mike


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

Reply via email to