如何让JFrame透明? [英] How to make JFrame transparent?

查看:107
本文介绍了如何让JFrame透明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让JFrame透明化?我想让我的JFrame透明化。当我的JFrame位于其上时,用户应该看到背景。

How to make JFrame transparent? I want to make my JFrame transparent. User should see the background when my JFrame is on top of it.

推荐答案

如果您对使用受限API没有任何异议然后,您可以使用 AWTUtilities 类和 setWindowOpacity()该类的方法执行此操作。 此处这里是如何使用它的教程? 此处是使用Java本机访问的版本。

If you do not have any objection in using restricted API classes then you can do this with AWTUtilities class and setWindowOpacity() method of that class. Here and here is a tutorial on how to use it? And here is the version using Java native access.

这篇关于如何让JFrame透明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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