Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setEnabled does not work

 
Mike London
Ranch Hand
Posts: 1224
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having a problem in an Applet.
I'm trying to do a JButton.setEnabled(false) from various places in the Applet, but the button will *not* disable programmatically.
The same code in a regular Java application works as expected.
I'm using Swing controls, but have the latest Java plug-in for the browser.
Any ideas why I can't disable the button?
Thanks much for any ideas.
-- Mike
 
Alan Mc
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that after initialisation, you can only change the setEnabled(boolean) value of an element within an actionEvent, or other action. Which I presume you were doing any way?
Al
 
Mike London
Ranch Hand
Posts: 1224
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup I was.
The same code works in a Java Application, but in the applet the button remains enabled.
???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic