1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Java + Rounded Rectangle Buttons !!!!!

Discussion in 'Software Development' started by Prashanti, Oct 16, 2008.

Thread Status:
Not open for further replies.
  1. Prashanti

    Prashanti Thread Starter

    Apr 24, 2006

    Without much ado let's get straight to the problem.

    I need to create Rounded Rectangle Buttons in java.
    Sounds very simple but I couldn't find any simple code to fix this problem!!! (n)

    Code would be very helpful.:)

    Please help!!!
  2. Chicon


    Jul 29, 2004
    Hi Prashanti,

    Unfortunately, there's no direct way to modify the rectangular shape of a button (AWT or Swing) even if you know how to customize its look-and-feel. Therefore, it's normal you can't find any simple code.
    BTW, if I were told to do such thing, I would use a borderless JLabel and a set of pre-build pictures showing the button I want in its different status : pressed, hovered, enabled, disabled, ... I would also make the mouse listener to check if the mouse pointer is within the 'clickable' area of the button.
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/759611

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice