Hi,
I currently have a method that is called on a ActionEvent of being clicked.
Now I want to call that method from another method.
Is there a way to do this with out having to just copy and paste my code into another method and just call that?
This is the method I want to call.
private void gameEndTurnBtnActionPerformed(java.awt.event.ActionEvent evt) {
if(theGame.WhosTurn() == 1)
{
theGame.SetWhosTurn(2);
theGame.ResetMoved(theGame.Team2());
}
else
{
theGame.SetWhosTurn(1);
theGame.ResetMoved(theGame.Team1());
theGame.callAI();
//want to call this method here. so as if someone had clicked the button to
//trigger this event like normal
}
ClearSelected();
ShowUnitInfo();
UpdateScreenBoard();
this.repaint();
}
Thanks in advance