2

I'm writing a typing application where jbutton should react on key pressing by changing it's color, but the Mac LAF refuses to change it and i don't want use other LAFs. Is their any way to use "system clicking effect" (button becomes gray for a sec) on key pressing event?

4lex1v
  • 21,197
  • 6
  • 51
  • 85

1 Answers1

2

1) easiest and by default correct way -->

2) possible way --> required deepest knowledge of Swing, Java and LookAndFeels,

  • not MacOSX user, don't know if you are using SystemLookAndFeeel or MetalLookAndFeel, but you could be able get and override from MetalButtonUI/QuaquaButtonUI extends BasicButtonUI, maybe this one can help you
Community
  • 1
  • 1
mKorbel
  • 109,107
  • 18
  • 130
  • 305
  • +1 Yes, this depends on the UI delegate; I've used this [alternative](http://stackoverflow.com/a/3420431/230513). – trashgod Feb 21 '12 at 19:28