<AWT Dev> Thoughts about 6402325 (Swing toolbars vs native toolbars on Windows)

Oleg Sukhodolsky son.two at gmail.com
Tue Aug 25 06:47:20 PDT 2009

On Tue, Aug 25, 2009 at 5:27 PM, Anthony Petrov<Anthony.Petrov at sun.com> wrote:
> Hello,
> The following change request has been filed some time ago:
> 6402325 (Swing toolbars vs native toolbars on Windows)
> http://bugs.sun.com/view_bug.do?bug_id=6402325
> The RFE proposes to tag toolbar windows so that the native system could
> modify their visual appearance and behavior in order to increase the
> native fidelity of Java applications. So, what about:
> **************************************************
> public enum java.awt.Window.Type {
> }
> public void java.awt.Window.setType(Type type);
> public Type java.awt.Window.getType();
> **************************************************
> ?

Some concerns about the idea:

- providing a setter for this property you open door for number of
questions such as "when this methods can be called" or "when user will
see result of the call"
- adding this property to Windows you create situation when some
methods of Window will not work (should not be called) in certain
situations, e.g.
  setUndecorated(), setWindowFocusableState() etc.

As possible resolution for the first issue we could use some factory
And I have no good ideas about ways to resolve the second issue :(


> Regarding implementation details:
> 1. The NORMAL windows are, well, the normal top-level windows - just
> like all windows currently behave in Java.
> 2. UTILITY: may have smaller decorations, are not focusable yet display
> their title-bar in the focused state when their owner frame is focused
> (given the native system supports that). On MS Windows this basically
> means setting the WS_EX_PALETTEWINDOW or just plain WS_EX_TOOLWINDOW
> extended style (see [1]). On X11 we can set the _NET_WM_WINDOW_TYPE hint to
> window manager decide how to treat these windows ([2]).
> The solution is open to further extending the number of supported window
> types in the future (POPUP, DOCK, NOTIFICATION, DND - to name a few).
> Opinions?
> [1] http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx
> [2] http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#id2551529
> --
> best regards,
> Anthony

More information about the awt-dev mailing list