DevFaqMixingLightweightHeavyweight

How to mix lightweight (Swing) and heavyweight (AWT) components?

Since JDK 6 update 12 and JDK 7, support for mixing of AWT (heavyweight, native widgets) and Swing (lightweight, pure Java widgets) is available and usually works quite well. However, placing a native AWT Component within a Swing container hierarchy with customizations may cause unwanted side-effects and can therefor be disabled.

As of NetBeans 7.3, an additional option has been added to etc/netbeans.conf to disable mixing by default:

-J-Dsun.awt.disableMixing=true

In some cases, such as displaying OpenGL content via JOGL, it may be necessary to add a native component to a NetBeans TopComponent. In that case, the default setting breaks usability of the platform application by incorrectly drawing menus and other lightweight components behind the native component. To re-enable the mixing, the above option needs to be set to false:

-J-Dsun.awt.disableMixing=false

For reference, see Oracle Notes on AWT


Applies to: NetBeans 7.3 and above

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo