<AWT Dev> [8] Request for review: JDK-8022512 JLightweightFrame: the content pane should be transparent

Anton V. Tarasov anton.tarasov at oracle.com
Tue Sep 10 11:10:16 PDT 2013

Hi Anthony,

Thanks for your point.

On 09.09.2013 17:26, Anthony Petrov wrote:
> Hi Anton,
> The fix looks good I suppose. However, are you sure we want to support transparent content in 
> embedded components? I understand that it's cool and stuff, but do we have to? We don't support 
> transparency for heavyweight embedded frames (e.g. applets), why would we want to support it for 
> the JLF? How are you going to handle mouse events on transparent parts? Will JFXPanel support the 
> same?

You're right, mouse events will anyway be caught by SwingNode on the transparent area. What would we 
do with that? I'm just thinking of the following:

1. Leave the Content Pane opaque.

2. Theoretically. Request a user to set a cutoff shape on the lightweight content, convert it then 
to a clip shape for SwingNode.

3. Document the restrictions concerning mouse events, and provide a property which would switch off 
the content pane's opacity.

What do you think of the third approach? What if a node behind a semi-transparent SwingNode doesn't 
have any interactivity in mind, and simply is a one way display? I just thought there might be an 
interest in this functionality. So, providing a documented or even undocumented property could be 

With regards to JFXPanel, as I can see it's the scene which stops transparency of the whole 
hierarchy (JFXPanel itself allows zero opacity). Allowing it to be transparent would make the case 
symmetrical. Wouldn't it?


> -- 
> best regards,
> Anthony
> On 09/03/2013 03:01 PM, Anton V. Tarasov wrote:
>> Please, review a fix.
>> jira: https://bugs.openjdk.java.net/browse/JDK-8022512
>> webrev: http://cr.openjdk.java.net/~ant/JDK-8022512/webrev.0/
>> Both JLF and its Content Pane are "transparent" to the client app, e.g.
>> SwingNode, in terms of functionality. They should be physically
>> transparent as well, in order to support translucent Swing content. This
>> is the case for JLF, but not for the Content Pane yet.
>> Thanks,
>> Anton.

More information about the awt-dev mailing list