• Post Reply Bookmark Topic Watch Topic
  • New Topic

Drawing a Circular JFrame

 
Sanan Mirzoyev
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey! Haha yet another question about my mp3 player project.
It is with regards to the GUI of the application.
I want to make the main shape of the player circular and I have already designed it in Photoshop.
I want to create a JFrame that will take the shape of this image without the rectangular border still being there (if that makes any sense!).
Any help would be really appreciated!
 
Campbell Ritchie
Marshal
Posts: 52581
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds more like a Swing topic . . .

If you search, you find this old thread where I was mistaken and somebody else was rude about round windows.

Read that and the included links.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java 6 Update 10 -a.k.a Consumer JRE- will have shaped windows.

I have to say that I agree with Jeff's sentiments about them, though.
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without Java 6u10, you can do this with native code (JNI) but it's not simple.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rob Prime:
Without Java 6u10, you can do this with native code (JNI) but it's not simple.


There was actually a library that made it somewhat painless but it only worked on Windows. Can't recall the name right now. Anyway here,

http://today.java.net/pub/a/today/2008/03/18/translucent-and-shaped-swing-windows.html

is an article on how to use the consumer JRE to get the effect.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!