带有Java 7的Mac OSX上的透明JFrame/JWindow [英] Transparent JFrame/JWindow on Mac OSX with Java 7

查看:170
本文介绍了带有Java 7的Mac OSX上的透明JFrame/JWindow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个屏幕共享小程序,该小程序打开了一个Swing JFrame,并使用Robot类在空框架后面捕获了屏幕.

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.

用户可以单击框架并与小程序后面的任何内容进行交互. 这在Windows上可以正常使用,并且可以与Apple的Java版本一起使用,但在Mac的Java 7中则无法使用.鼠标单击不会通过JFrame.

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.

JFrame使用:

setAlwaysOnTop(true);
setUndecorated(true);

尝试使用:

AWTUtilities.setWindowOpaque(false);

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

在Apple版本中:

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

Call成功了,但这已不再起作用.

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

请告知.

谢谢, 埃隆

推荐答案

这是jdk 7中的错误(将在jdk 9中修复).只有使用jdk 6的方法.

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

链接到错误数据库

P.s.您找到这个问题的解决方案了吗?

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

这篇关于带有Java 7的Mac OSX上的透明JFrame/JWindow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆