Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6477497

Windows drawn off-screen on Win98, even when java.awt.Window.locationByPlatform is set

XMLWordPrintable

    • b04
    • generic
    • windows_98
    • Not verified

      I have a swing app that has been developed on Windows XP, and I'm using
          System.setProperty("java.awt.Window.locationByPlatform", "true");
      to make the windows use the default XP placement algorithm. This works a treat, but when I deploy the application on Win98 the windows appear correctly the first time the application is run, but on subsequent runs they are drawn completely off-screen - the application shows up as an icon in the Windows taskbar, but it's not visible. I initialy thought this might be due to me using Webstart to deploy the app, but it's the same if I run it directly. Something that might be relevant: I'm running the app under the Windows L&F using
          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

      I've tried setting the positioning on a per-window basis using
          setLocationByPlatform(true);
      before the window is setVisible(), but that has no effect either.

      I do have a workaround, but it's inconvenient as it means I have to add it to each of my application windows, if I make a call to
          setLocationRelativeTo(null);
      or
          setLocationRelativeTo(parentWindow);
      as appropriate, then the behaviour is as I expect - centred for the case where the window parameter is null, and positioned relative to the parent window otherwise.

            anthony Anthony Petrov (Inactive)
            alanbur Alan Burlison
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: