Solved

Circular JFrame

Posted on 2010-11-13
8
509 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 500 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

762 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