Solved

Circular JFrame

Posted on 2010-11-13
8
507 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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 117
Checkbox and ListView in Android Layout 4 68
How to convert from xls to xlsx using java 7 42
Selenium docs api java index 3 19
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

831 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