Results 1 to 2 of 2
  1. #1
    FaRuK is offline Member
    Join Date
    May 2007
    Posts
    7
    Rep Power
    0

    Default How to change shape of JButton

    Can we reshape a JButton for example into a star or circle?

  2. #2
    johnt is offline Super Moderator
    Join Date
    Apr 2007
    Posts
    30
    Rep Power
    0

    Default

    You can extend Jbutton and override paint() (paint, not paintComponent() and don't call super.paint() either). Then you can do whatever drawing you want. Might also need to look at the source code of JButton to see how you can override the mouse handling for clicking.

Similar Threads

  1. Help with Move Shape
    By romina in forum AWT / Swing
    Replies: 2
    Last Post: 12-09-2010, 04:25 AM
  2. implementing shape
    By sidkdbl07 in forum Java 2D
    Replies: 1
    Last Post: 01-12-2008, 07:42 PM
  3. weird looking shape JButton is it possible?
    By unhurt in forum AWT / Swing
    Replies: 8
    Last Post: 11-03-2007, 10:10 AM
  4. tool to create shape frame
    By boy22 in forum AWT / Swing
    Replies: 1
    Last Post: 08-05-2007, 05:10 AM
  5. Problem with JButton
    By Marcus in forum AWT / Swing
    Replies: 1
    Last Post: 07-05-2007, 06:56 AM

Posting Permissions

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