开发者

changing the shape of jframe

开发者 https://www.devze.com 2023-02-16 03:32 出处:网络
I don\'t know w开发者_如何学JAVAhether it is possible or not.Is there any way to change the shape of jframe into circleEssentially what you have to do is make the outer part of your JFrame rendered su

I don't know w开发者_如何学JAVAhether it is possible or not.Is there any way to change the shape of jframe into circle


Essentially what you have to do is make the outer part of your JFrame rendered surface transparent and then draw your own custom shape in the middle.

This will get you started:

http://java.sun.com/developer/technicalArticles/GUI/translucent_shaped_windows/

And this is a finished implementation:

http://www.codeproject.com/KB/java/shaped-transparent-jframe.aspx


//You can change the shape of JFrame import java.awt.geom.*;

setUndecorated(true);
Ellipse2D.Double E=new Ellipse2D.Double(0,0,500,500); //nested class Double## 

 - Heading

 ##
setShape(E);
setVisible(true);
0

精彩评论

暂无评论...
验证码 换一张
取 消