Results 1 to 5 of 5
  1. #1
    OllyHal is offline Member
    Join Date
    Feb 2012
    Posts
    25
    Rep Power
    0

    Default Adding a shadow to a JButton?

    Hi,

    I am wondering how I would go about adding a shadow to a button in swing, I have looked around on google but can't find anything. Any help is much appreciated.

    Thanks,

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,956
    Rep Power
    8

    Default Re: Adding a shadow to a JButton?

    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,234
    Rep Power
    19

    Default Re: Adding a shadow to a JButton?

    Or switch to Java FX 2 which has a DropShadow effect.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    OllyHal is offline Member
    Join Date
    Feb 2012
    Posts
    25
    Rep Power
    0

    Default Re: Adding a shadow to a JButton?

    I like the look of java fx but is it easy to implement it into swing?

    I really don't want to rewrite my whole GUI...
    Last edited by OllyHal; 04-19-2012 at 07:09 PM.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,234
    Rep Power
    19

    Default Re: Adding a shadow to a JButton?

    Quote Originally Posted by OllyHal View Post
    I like the look of java fx but is it easy to implement it into swing?
    Not difficult, but the code can be verbose in the extreme due to having to respect the two GUI threads (Swing's EDT and FX's Application thread).

    I wouldn't recommend mixing the two.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Adding JButton to JPanel
    By razmyasdfg in forum AWT / Swing
    Replies: 8
    Last Post: 05-23-2011, 11:03 PM
  2. Adding JPEG to JButton Child
    By rsieberg in forum AWT / Swing
    Replies: 3
    Last Post: 03-27-2011, 08:33 PM
  3. adding JList and JButton to a TabbedPane
    By hariza in forum AWT / Swing
    Replies: 13
    Last Post: 10-06-2010, 01:46 AM
  4. Adding JButton to a JTable
    By ting.at.net@hotmail.com in forum AWT / Swing
    Replies: 6
    Last Post: 05-26-2009, 03:37 AM
  5. adding Image to JButton
    By mayhewj7 in forum New To Java
    Replies: 3
    Last Post: 03-31-2009, 03:39 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
  •