swing - Java basic if/else statement state change -
please see attached code below , question @ end. class events extends jframe{ private jlabel label; private jbutton button; public events() { setlayout(new flowlayout()); button = new jbutton("click text"); add(button); label = new jlabel(""); add(label); event e = new event(); button.addactionlistener(e); } public class event implements actionlistener { public void actionperformed(actionevent e) { int x = 0; if (x == 0) { label.settext("the new label"); system.out .println("setting x 0 , label display label"); x = 1; system.out.println(x); } else { label.settext("newerer label"); system.out.println("i reached else segment"); x = 0; system.out.pr...