Creating a Java Swing JFrame with a circular shape?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 04:15:50

问题


How to make a circular JFrame if possible?


回答1:


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

Shaped Windows

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:

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



来源:https://stackoverflow.com/questions/5154880/creating-a-java-swing-jframe-with-a-circular-shape

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!