创建一个圆形的Java Swing JFrame? [英] Creating a Java Swing JFrame with a circular shape?

查看:384
本文介绍了创建一个圆形的Java Swing JFrame?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果可能的话如何制作一个循环的JFrame?

How to make a circular JFrame if possible?

推荐答案

Oracle有一个关于这个主题的很好的教程:
https://docs.oracle.com/javase/tutorial/uiswing /misc/trans_shaped_windows.html

Oracle has a nice tutorial on exactly this topic: https://docs.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html

塑造Windows



版本6u10中引入的另一个功能是塑造
效果的窗口。使用整形,您可以将任何
形状设置为未修饰的窗口。当
应用效果时,窗口所需的
区域变为透明。
因此,透明
和非透明像素的组合形成给定窗口的
形状。下一个
图像演示了
两种情况下的窗口整形:

The other feature introduced in release 6u10 is the window shaping effect. Using shaping you can set any shape to an undecorated window. When the effect is applied, the desired area of a window becomes transparent. Thus, the combination of transparent and non-transparent pixels form the shape of a given window. The next images demonstrate window shaping in two cases:

[从原始文章中提取的文本 http://www.oracle.com/technetwork/articles/javase /translucent-shaped-windows-139324.html ]

[Text extracted from original article http://www.oracle.com/technetwork/articles/javase/translucent-shaped-windows-139324.html ]

这篇关于创建一个圆形的Java Swing JFrame?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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