Skip to main content

AWT/Swing Mixing still an issue on MAC OSX?

2 replies [Last post]
Joined: 2010-02-21

Hi registered onto this forum out of desperation for a solution to a strange problem.

I work at a local university as a research assistant and my main task is developing a GUI application in java.The Java software I'm working on uses both Swing and AWT components from processing.core package. In essence I am developing a new Look and Feel (which actually heavily extends from MetalL&F) and at times I am tasked to completely new/modified components. As a student I am not an expert in the area and I learn as things go along.

Now to my knowledge mixing lightweight and heavyweight components was fixed in Java 6 Update 12. I believed that this fix was universal across all platforms. Note: I am a primary windows user and do not own a machine with OSX.

Unfortunately it appear not to be true. The other day I was handed a OSX machine and discovered that a lightweight component such as the popup from a combo box or a tooltip will be covered by heavy weight components.

Initially I thought I could fix this problem using the setLightWeightPopupEnabled(boolean flag); methods in both ToolTipManger and JComboBox to false. But this creates a whole new problem on Mac OSX causing all heavyweight components to flicker gray as they are repainted whenever a popup action is called.
Note: Strangely calling JPopup by it self does cause any problems at all in OSX.

Notice non of these issue appear on my Windows Machine just OSX. Has Java 6 update 12 been released for OSX? Its quite an old update to my knowledge.

Can anyone help me with some advice? My higherups tell me that the software I'm developing will mostly be used by students using Macs with OSX.

In regards to the mixing l/h components: See the following

The main graphical component of the application is being created extending from
PApplet which is an extension of AWT.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2011-01-19

I'm having the same problem here.
I have a layered pane, with a lightweight on top of a heavyweight. Works fine on Ubuntu and Windows XP, but not on mac.
Were you able to solve this?
BTW, I'm using this approach

Joined: 2006-07-24


The hw/lw mixing feature has been implemented for Sun's Java implementation which is mostly available for Windows, Linux, and Solaris platforms only. I suggest you ask the question on Apple's Java forums. In the meantime, I also suggest to read the article [1] that describes the feature in details.


best regards,