Circular JFrame

Overwhelmed with the help so far...
thanks a lot all .

I am trying to get a JFrame in the shape of a circle ..

I will be really grateful if someone can give some code snippet ..

thanks again !
hipalAsked:
Who is Participating?
 
CEHJCommented:
You'd need native code to 'fake' roundness with transparency. Try this

http://jna.dev.java.net/demo/ShapedWindowDemo.jnlp
0
 
CEHJCommented:
Not possible i'm afraid. JFrame is a top level window and they are never round
0
 
hipalAuthor Commented:
how about JPanel ?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
objectsCommented:
All components are rectangular by definition, and top level windows are tied to the native window system which is also rectangular.

you can give a component the illusion of not being rectangular by leaving the background transparent.
0
 
hipalAuthor Commented:
thanks all ..

can I do similar things for JButton ?
0
 
hipalAuthor Commented:
@CHEJ .. I am not able to find the code for the link you send :(
0
 
objectsCommented:
How does that help you exactly?
(and you don't need to write any native code)
0
 
CEHJCommented:
>>@CHEJ .. I am not able to find the code for the link you send :(

I think you'll need to check it out from Subversion (for which you'll need an account)

https://jna.dev.java.net/source/browse/jna/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.