Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to gray out buttons  RSS feed

 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How do I gray out buttons that I don't want users to use until the time is right?
 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried setEnabled/Disabled. This works but I need to change the color to gray myself.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should gray out automatically when you call setEnabled( false )... What version of the JDK and what look & feel are you using?
 
raj madhuram
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Aruna Raghavan:
I tried setEnabled/Disabled. This works but I need to change the color to gray myself.

Hi,
You could use setBackground() method to change its color.
Raj
 
Pondy Prem
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you say "I don't want user to use". Then you must use setEnabled(false).
However, if you are talking about achieving your own button behaviour for enabling/disabling.. then you may have to create your own implementation for View&Controller classes.
Thx
pondyprem@yahoo.com
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!