The contents of the button event
public void actionPerformed(ActionEvent e){
           a.kae();
  }
And make another class.
class a{
	public int test = 0;
	public void kae(){
		test=1;
		if(test==1){
			System.out.println("success");}
	}
}
Anyway, when a button event happens The value of class a changes and it passes if.
Recommended Posts