File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes irregular shaped components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "irregular shaped components" Watch "irregular shaped components" New topic

irregular shaped components

Scott Presley

Joined: Apr 15, 2003
Posts: 25
I've got a requirement to build a component resembling a circular pizza. I need to be able to attach a mouse listener to each individual �slice� If the pizza was square, I could simply represent each �slice� as a JPanel, but since the slices aren�t square, a JPanel really doesn�t make sense. Does anyone know if I could extend JComponent to form an irregular (non-square) component?

One additional note... there are more requirements than just mouse listening, so simply tracking the mouse position isn't a viable solution...
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
this might(?) be worth a look
I agree. Here's the link:
subject: irregular shaped components
jQuery in Action, 3rd edition