Results 1 to 3 of 3
  1. #1
    zenMarko is offline Member
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    Default polygon-shaped JComponent

    I would like to create a class that extends JComponent, but that has any polygonal shape (as you would describe a Polygon object). Any thoughts on how to do this?

  2. #2
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default

    If i understand correctly you could have a Polygon interface where you define common values that every polygon will have(like sides,area, etc). From there i'm not really sure. Hope that at least gets you in the water

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,576
    Rep Power
    23

    Default

    create a class that extends JComponent, but that has any polygonal shape
    Don't know if JComponents can be other than rectangular. I assume that part of the reason for trying to extend JComponent is so that the component will draw itself when in a container.

    Perhaps you want to create a lightweight component with its own methods and attributes.

Similar Threads

  1. Random Points inside a Polygon
    By nidhirastogi in forum Advanced Java
    Replies: 1
    Last Post: 09-23-2008, 03:28 AM
  2. Ring Shaped Shell in SWT
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-25-2008, 02:28 PM
  3. How to Fill a Polygon in Java
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-22-2008, 11:10 PM
  4. How to Draw a Polygon in Java
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-22-2008, 11:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •