I don't know whether it is possible or not.Is there any way to change the shape of jframe into circle
Asked
Active
Viewed 2,930 times
2

mKorbel
- 109,525
- 20
- 134
- 319

V I J E S H
- 7,464
- 10
- 29
- 37
-
possible duplicate of [Swing circular JFrame](http://stackoverflow.com/questions/5156912/swing-circular-jframe) – jmj Mar 10 '11 at 10:18
-
You should try to Google some keywords. This is a lesson: "Google is your best friend" (http://tinyurl.com/5ssmucf) – Martijn Courteaux Mar 10 '11 at 12:15
2 Answers
5
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

Bernd Elkemann
- 23,242
- 4
- 37
- 66
-
-
@Martijn Indeed. "I feel lucky". This time google actually did a good job finding what I needed; most of the time it just finds what is popular (or worse: established). – Bernd Elkemann Mar 10 '11 at 12:24
1
//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);

Moshe Slavin
- 5,127
- 5
- 23
- 38

Imtiyaz Ansari
- 11
- 1