• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Irregular shaped JComponents

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm going to start a new project that includes "puzzle pieces". Each piece "interlocks" to another peice, as a real world puzzle would.

I need to highlight each piece when the mouse travels over it (using a MouseMotionListener). This is easy to do with square or rectangular shapes, but I've not tried this with odd shape pieces. I could certainly have the centers act as the "hotspot", but this isn't really what the customer wants. The piece should highlight when any portion of it is under the cursor.

This project (or at least this one part of it) would be easy to do in Flash. Any suggestions on how to do it Java?
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can find information on this in the 2D Graphics trail, especially the pages Stroking and Filling Graphics Primitives,
Constructing Complex Shapes from Geometry Primitives and the page that follows.
 
reply
    Bookmark Topic Watch Topic
  • New Topic