If you are wanting to be able to click on the button and it will set it's text to "Hello" then when you click on it again it says "Goodbye" you could do something similar to this:
Initialize a variable to track which button stage where at at:
public void actionPerformed(ActionEvent event){
switch(buttonStage){
case 1:
button.setText("Click me");
break;
case 2:
button.setText("Click me again!");
break;
case 3:
button.setText("do it Again");
break;
}
switch(buttonStage){
case 1:
buttonStage = 2;
break;
case 2:
buttonStage = 3;
break;
case 3:
buttonStage = 4;
break;
buttonStage = 1;
}
Etc.
and when i assign another button.setText();, it doesn't do the first action.
Any help?
Free + Crabs + Ability to trample/suffocate opponents in Cortex Command = Free Bombs.
Initialize a variable to track which button stage where at at:
Then under your button clicking code just do something like this:
hope this helps.
Want a place to advertise your Minecraft server? try MyMCStatus.net now!
1 click = click me
2 clicks = click again
3 clicks = do it again
and everytime it was clicked it would do 1, then 2, then 3. Get the idea?
Free + Crabs + Ability to trample/suffocate opponents in Cortex Command = Free Bombs.
switch(buttonStage){
case 1:
buttonStage = 2;
break;
case 2:
buttonStage = 3;
break;
case 3:
buttonStage = 4;
break;
buttonStage = 1;
}
Etc.
this is java. And i'm just doing it to get the hang of it before i get serious in modding.
btw, thanks teh rhio!
Free + Crabs + Ability to trample/suffocate opponents in Cortex Command = Free Bombs.
Multicast delegates.