Dialogs created using the Dialogs API are automatically centered, but are centered within the entire screen rather than
within the application that generated them. It would be more consistent with the behavior of other applications if it
was centered within the application's main window and would also make it more obvious which application generated the
dialog when multiple applications are running simultaneously.
To reproduce, launch the IDE and resize it to take up only the upper-right 10% of the screen. Click the File menu and
then choose "New Project..." and you will see the dialog lies outside of the application window. Similar behavior can
be observed on any platform-based application that uses the Dialogs API and its default implementation.
Line 236 in NbPresenter.java (in 6.0 final sources) calls setBounds, passing the calculated center of the screen.
I think it would be preferable to replace this with something like the following.
This will basically center on the parent if it's not null, and center on the screen otherwise.
If a change in the default behavior is not possible, we'd appreciate knowing how to change it locally without patching
source code or mostly duplicating the default Dialogs API implementation which is otherwise OK.
It should consult it with UI team before changing behavior what it is in NetBeans for ages.
Maybe an easy alternative is that the default behavior remains the same and dialogs will be centered above the application window only if some system
property is set. This would maintain compatibility, be easy to implement and satisfy people who need either behavior.
Jano, could you please look on this problem? AFAIK, all NetBeans dialogs what are just simple using Openide Dialogs API
are centered in screen. But for example Open Project dialog is centered in Application (I suppose it handle it itself)
it should be uniform. Any thoughts? What might be better? Thanks
I briefly checked other apps on Win XP and there doesn't seem to be a standard behavior. I can imagine users using NetBeans IDE on very big monitors where
NB window takes only part on the whole screen. In such setup it's probably better if dialogs popup above the NetBeans window, not centered on the screen.
Similarly for apps built on top of NetBeans.
So yes, centering in NetBeans may be better.
Just note that there are users who two monitors next to each other as a single virtual screen and NetBeans is expanded through the whole area cross both
monitors. In such case a dialog box has to open centered on the primary monitor, not in NetBeans window as it would open right cross the connection of two
monitors and become unusable.
jrojcek makes some good observations. The developer who originally brought this to my attention has a huge monitor (24"
LCD). I have two 21" monitors as a single desktop both at home and work.
The suggestion can work but I'm not sure it's good time for such UI changes now. I'm familiar with current centering in
screen and when I was trying center in application it had effect a bad surprise to me. What about to post-pone this
after NB6.5? Anyway, it should be tracked as late UI change in NB6.5 I have lack of justification for such change IMHO.
I'm going to remove fix-in-65 from whiteboard.
I am the original reporter. It is OK with me to postpone for 6.5 but IMHO it should definitely be considered for post
Created attachment 69620 [details]
prototype core.windows to platform9/modules
I found out it works incorrectly if I undock some tab out of IDE main window. In that case new dialogs are centering
still in main window instead of undocked tab. I attached core/windows jar using this proposal for playing with it. But I
still don't think it could be fixed in NB6.5
> don't think it could be fixed in NB6.5
It's RFE currently tracked in NB7.0 plan.
Integrated into 'main-golden', will be available in build *201304272301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: S. Aubrecht <firstname.lastname@example.org>
Log: #133235 - open dialogs centered on the main app window