Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Circular JFrame

Posted on 2010-11-13
8
Medium Priority
?
514 Views
Last Modified: 2012-05-10
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
Comment
Question by:hipal
  • 3
  • 3
  • 2
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 34128109
Not possible i'm afraid. JFrame is a top level window and they are never round
0
 

Author Comment

by:hipal
ID: 34128129
how about JPanel ?
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 34128333
You'd need native code to 'fake' roundness with transparency. Try this

http://jna.dev.java.net/demo/ShapedWindowDemo.jnlp
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Expert Comment

by:objects
ID: 34128990
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
 

Author Comment

by:hipal
ID: 34129598
thanks all ..

can I do similar things for JButton ?
0
 

Author Comment

by:hipal
ID: 34129601
@CHEJ .. I am not able to find the code for the link you send :(
0
 
LVL 92

Expert Comment

by:objects
ID: 34129640
How does that help you exactly?
(and you don't need to write any native code)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34130564
>>@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

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question