How to grey/gray out a JButton?

Discussion in 'Java' started by RC, Apr 11, 2006.

  1. RC

    RC Guest

    How do I set a JButton to un-clickable, the text is gray out;
    later I can reset it back to clickable, the text return to normal?
    Thank Q very much!

    P.S. removeActionListener will be no command action only, but the button
    still clickable and text is not grey out.
    RC, Apr 11, 2006
    #1
    1. Advertising

  2. RC

    VisionSet Guest

    "RC" <> wrote in message
    news:e1gnro$gus$...
    > How do I set a JButton to un-clickable, the text is gray out;
    > later I can reset it back to clickable, the text return to normal?
    > Thank Q very much!
    >
    > P.S. removeActionListener will be no command action only, but the button
    > still clickable and text is not grey out.


    setEnabled(false)

    --
    Mike W
    VisionSet, Apr 11, 2006
    #2
    1. Advertising

  3. RC

    Roedy Green Guest

    On Tue, 11 Apr 2006 12:23:43 -0400, RC <> wrote,
    quoted or indirectly quoted someone who said :

    >How do I set a JButton to un-clickable, the text is gray out;
    >later I can reset it back to clickable, the text return to normal?


    see setEnabled

    see http://mindprod.com/jgloss/jbutton.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Apr 11, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Davef

    gray out textbow clietside?

    Davef, Aug 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    387
    Davef
    Aug 15, 2003
  2. Anony!

    How to "grey out" a JButton?

    Anony!, Aug 15, 2004, in forum: Java
    Replies:
    3
    Views:
    796
    zoopy
    Aug 16, 2004
  3. Karl

    Javascript grey out

    Karl, Feb 15, 2009, in forum: HTML
    Replies:
    2
    Views:
    1,125
    Harlan Messinger
    Feb 15, 2009
  4. J Belly

    Grey out or disable form?

    J Belly, Feb 4, 2005, in forum: Javascript
    Replies:
    1
    Views:
    128
    Joakim Braun
    Feb 6, 2005
  5. acord

    grey-out/disabled item in listbox

    acord, Mar 11, 2006, in forum: Javascript
    Replies:
    3
    Views:
    240
    acord
    Mar 11, 2006
Loading...

Share This Page