Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By jim829

Thread: Changing the appearance of a disabled button

  1. #1
    nubshat is offline Member
    Join Date
    Mar 2013
    Rep Power

    Default Changing the appearance of a disabled button

    I currently have a program with a button that has an icon on it. When I disable the button, the icon turns grey. Is there any way to disable the button, but have it appear like it's enabled?

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Northern Virginia, United States
    Rep Power

    Default Re: Changing the appearance of a disabled button

    Here is a general solution to your question and possible future questions. When asking about a specific class, look at all the methods of that class as well as the super classes. In this case the super class of JButton is AbstractButton. By doing this you may not only find answers to your current question but find useful methods you can use in the future.

    The answer is to use the setDisabledIcon method.

    nubshat likes this.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Text is not greyed out on a disabled button
    By new2java2009 in forum AWT / Swing
    Replies: 2
    Last Post: 01-26-2012, 06:15 PM
  2. Replies: 3
    Last Post: 08-02-2011, 07:11 AM
  3. tooltip should be visible when button disabled
    By Sureshgurram in forum SWT / JFace
    Replies: 1
    Last Post: 11-23-2010, 09:58 AM
  4. how to disabled button...?
    By mlibot in forum New To Java
    Replies: 0
    Last Post: 10-09-2009, 08:36 AM
  5. button is not getting disabled on onload event
    By Harshada in forum Advanced Java
    Replies: 2
    Last Post: 03-08-2009, 02:03 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