How to reset a button

Page 1 of 1

3 Replies - 111 Views - Last Post: 07 December 2012 - 08:10 AM Rate Topic: -----

#1 john186  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-December 12

How to reset a button

Posted 07 December 2012 - 07:26 AM

this is my code
if (e.getSource() == btnHOLD ){
    	  btnHOLD1.setLabel("Held ");
    	  btnHOLD1.setBackground(Color.yellow);

Here i have changed the btn hold to label held
my question is how do i switch it back to btnhold thanks
Is This A Good Question/Topic? 0
  • +

Replies To: How to reset a button

#2 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 387
  • View blog
  • Posts: 2,666
  • Joined: 12-January 10

Re: How to reset a button

Posted 07 December 2012 - 07:59 AM

what do you mean get it back to btnhold?
Was This Post Helpful? 0
  • +
  • -

#3 john186  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-December 12

Re: How to reset a button

Posted 07 December 2012 - 08:09 AM

if (e.getSource() == "hold1" ){//the label before clicking btnhold was hold1
    	  btnHOLD1.setLabel("Held 1");//A user click on btn hold the label changes to held1 and background to yellow
    	  btnHOLD1.setBackground(Color.yellow);




then when btnhold is clicked again how do i change it back to hold1?
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10194
  • View blog
  • Posts: 37,646
  • Joined: 27-December 08

Re: How to reset a button

Posted 07 December 2012 - 08:10 AM

Please avoid duplicate posting.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1