Hi Robert,
I'm using KDE.
I think I found a way to temporary solve the problem in my case.
I've noticed that JWindow.setLocation() works fine if the JWindow.isVisible().

Fortunately, I use a class that extends JWindow, so I have overridden the
setLocation method:
public void setLocation(int x, int y)
{
    if(!isVisible())
    {
        setVisible(true);
        super.setLocation(x,y);
        setVisible(false);
    }
    else
        super.setLocation(x,y);
}

And now it seems to work.

Robert P. Biuk-Aghai wrote:

> I suspect it's a window manager problem. Which wm do you use?

>
>
> I too have noticed problems that I believe to be wm problems. In my
> case, using fvwm, when I start an application (extending JFrame from
> Swing 1.0.2) with a menubar it is placed at position 0,0. When I click
> on a menu in the menubar, the menu is displayed aligned with the top
> edge of the menubar, which is also the top edge of the JFrame's
> internal area, rather than being aligned with the bottom edge of the
> menubar. This has unpleasant side effects when clicking on the menu
> and releasing the mouse button, as this is taken as a mouse click on
> whatever menu item (mostly the first one) that is displayed in the
> menu at that position), rather than posting the menu below the mouse
> cursor awaiting user selection. However, when I move the window
> around, even back to 0,0, it works fine.
>
> Any advice on this one, or do I just have bear it with patience?
>
> Robert.
>
> On Fri, 27 Nov 1998, Catalin CLIMOV wrote:
>
> > Hi,
> >     I have an application in a JFrame, and sometimes I have to show a
> > JWindow somewhere on the screen.
> > It seems JWindow.setLocation() is not working properly. To be more
> > precise, my JWindow appears always at (0,0), doesn't matter the real
> > location I want.
> > But if I move the JFrame on the screen (with the mouse), and then
> > display JWindow, it shows where it has to.
> > I use jdk 1.1.7-v1a-glibc with native threads on a RedHat5.1.
> >
> > Does anyone know what is happening, and how can I solve that ?
> >
> > Catalin.
> >
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Robert P Biuk-Aghai, University of Macau, Faculty of Science and Technology
> http://hyperg.sftw.umac.mo/robert/    tel: +853-3974365    fax: +853-838314
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Microsoft isn't the answer. Microsoft is the question and the answer is no.



--
 \|/ ____ \|/
  @~/ Oo \~@
 /_( \__/ )_\
    \__U_/


Reply via email to