This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 153516 - Dialog boxes open in a wrong display
Summary: Dialog boxes open in a wrong display
Status: RESOLVED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: DUAL_MONITOR
Depends on:
Blocks:
 
Reported: 2008-11-20 09:55 UTC by jkarinkanta
Modified: 2009-05-25 21:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
JavaDoc in wrong display (190.02 KB, image/gif)
2009-02-12 08:37 UTC, jkarinkanta
Details
Tools / Options in wrong display (368.07 KB, image/gif)
2009-02-12 08:38 UTC, jkarinkanta
Details
swingset demo (1.40 MB, image/png)
2009-02-12 13:29 UTC, Stanislav Aubrecht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jkarinkanta 2008-11-20 09:55:45 UTC
I have douple display configured so that windows desktop uses both displays. (I use netbeans so that its main window is
widened over these two physical displays.) When I open e.g. tools -> options, the options window opens incorrectly into
the right display. In NB6.1 it opened correctly into left display. 

In my mind window should open into the left display OR into the display where it last time was closed.
Comment 1 Lukas Hasik 2008-11-20 10:31:32 UTC
afaik, it openes on primary display. Could you check it?
Comment 2 jkarinkanta 2008-11-20 10:37:58 UTC
Hi, I also noticed that when I point a java function and ctrl + space bar to open java doc, it opens in the right
display although cursor ( and java function name ) is in the left display. Jouni
Comment 3 Stanislav Aubrecht 2008-11-24 09:18:21 UTC
please provide jdk version info.
also pls try reproducing this behavior with swingset demo - there's a tab which opens some standard file browse dialog
and message panes, thanks.
Comment 4 jkarinkanta 2008-12-05 12:38:36 UTC
I checked that window opens to NON-primary display.  I did not change any display settings after updating NB6.1 -> NB6.5.

JDK is 1.6.0_10
Comment 5 jkarinkanta 2008-12-05 12:45:01 UTC
Where can I find this "swingset demo"?
Comment 6 Stanislav Aubrecht 2008-12-05 13:10:55 UTC
look for SwingSet2.jar in <jdk_home>/demo/jfc/SwingSet2
Comment 7 jkarinkanta 2008-12-05 14:26:55 UTC
I run jdk SwingSet2 demo (Demo opened into the left display) and tried following demos: JFileChooserDemo,
OptionPaneDemo: They opened all windows correctly into the primary display = left display.
Then I tried Multiscreen -> "Create ... on all screens" command and new SwingSet2 windows opened into both displays
Then I tried Multiscreen -> "Create ... on screen 0" command and new SwingSet2 window opened into left display (=
primary display)
Then I tried Multiscreen -> "Create ... on screen 1" command and new SwingSet2 window opened into right display

Then I tried following demos: JFileChooserDemo, OptionPaneDeom with the SwingSet2 window opened by hitting "Create ...
on screen 0" : All windows opened into the primary display = left display.
Then I tried following demos: JFileChooserDemo, OptionPaneDeom with the SwingSet2 window opened by hitting "Create ...
on screen 1" : All windows opened into the non-primary display = right display.

I did not compile SwingSet2.jar but run it as it is delivered.
Comment 8 Stanislav Aubrecht 2009-02-12 07:50:57 UTC
i couldn't reproduce the problem. all dialog windows open correctly in the primary display.
can you pls provide some screen shots? thanks
Comment 9 jkarinkanta 2009-02-12 08:35:54 UTC
Here are 2 gif files:
First with Java doc in wrong display when I pointed ExceptionUtil.getLocationInCode -function and hit ctrl+space.
Second with Tools/Options window in wrong display. Note that there is also Control Panel / Display properties which
shows that left screen is really the primary screen.
Comment 10 jkarinkanta 2009-02-12 08:37:21 UTC
Created attachment 76898 [details]
JavaDoc in wrong display
Comment 11 jkarinkanta 2009-02-12 08:38:28 UTC
Created attachment 76899 [details]
Tools / Options in wrong display
Comment 12 Stanislav Aubrecht 2009-02-12 13:29:17 UTC
Created attachment 76915 [details]
swingset demo
Comment 13 Stanislav Aubrecht 2009-02-12 13:33:00 UTC
i have reproduced this issue with swingset demo as well, see attached screenshot.
when the application is too wide then dialogs open on secondary monitor, otherwise dialog windows open correctly on the
primary screen.
the problem is in Window.setLocationRelativeTo(Component) which tries to center the dialog window above the given
component and it's failing in some cases on dual monitor setup.
you may consider filing a bug against JDK: http://bugreport.sun.com/bugreport/