| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| // |
| |
| = DevFaqMixingLightweightHeavyweight |
| :jbake-type: wiki |
| :jbake-tags: wiki, devfaq, needsreview |
| :jbake-status: published |
| :keywords: Apache NetBeans wiki DevFaqMixingLightweightHeavyweight |
| :description: Apache NetBeans wiki DevFaqMixingLightweightHeavyweight |
| :toc: left |
| :toc-title: |
| :syntax: true |
| |
| == 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: |
| |
| [source,java] |
| ---- |
| |
| -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: |
| |
| [source,java] |
| ---- |
| |
| -J-Dsun.awt.disableMixing=false |
| ---- |
| |
| For reference, see link:http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-Desktop/html/awt.html[Oracle Notes on AWT] |
| |
| <hr/> |
| Applies to: NetBeans 7.3 and above |
| |
| === Apache Migration Information |
| |
| The content in this page was kindly donated by Oracle Corp. to the |
| Apache Software Foundation. |
| |
| This page was exported from link:http://wiki.netbeans.org/DevFaqMixingLightweightHeavyweight[http://wiki.netbeans.org/DevFaqMixingLightweightHeavyweight] , |
| that was last modified by NetBeans user Nhoffmann |
| on 2013-02-26T14:08:59Z. |
| |
| |
| *NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed. |