• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 515
  • Last Modified:

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 !
0
hipal
Asked:
hipal
  • 3
  • 3
  • 2
1 Solution
 
CEHJCommented:
Not possible i'm afraid. JFrame is a top level window and they are never round
0
 
hipalAuthor Commented:
how about JPanel ?
0
 
CEHJCommented:
You'd need native code to 'fake' roundness with transparency. Try this

http://jna.dev.java.net/demo/ShapedWindowDemo.jnlp
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now