Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparent JFrame/JWindow on Mac OSX with Java 7

We have a screen sharing applet that opens up a Swing JFrame and uses the Robot class to capture the screen behind the empty frame.

The user is able to click through the frame and interact with whatever lies behind the applet. This works fine on Windows and used to work with Apple's Java version, but with Java 7 for Mac it does not work. Mouse clicks does not go through the JFrame.

The JFrame uses:

setAlwaysOnTop(true);
setUndecorated(true);

Tried using:

AWTUtilities.setWindowOpaque(false);

Or

setBackground(new Color(0, 0, 0, 0));

With Apple's version the:

getRootPane().putClientProperty("apple.awt.draggableWindowBackground", Boolean.FALSE);

Call did the trick, but this is no longer working.

Please advise.

Thanks, Eilon

like image 876
user1766744 Avatar asked Jul 02 '26 14:07

user1766744


1 Answers

It's bug in jdk 7(will be fixed in jdk 9). There only way to use jdk 6.

link to bug database

P.s. have you find any solution of this problem?

like image 127
Dmytro Danilenkov Avatar answered Jul 04 '26 04:07

Dmytro Danilenkov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!