Having a problem getting my ActionListeners, Handlers, and GUI to communicate.
Posted
by badpanda
on Stack Overflow
See other posts from Stack Overflow
or by badpanda
Published on 2010-04-15T01:22:09Z
Indexed on
2010/04/15
1:23 UTC
Read the original article
Hit count: 276
So I am trying to get my GUI to work. When I run the code below, it does nothing, and I'm sure I'm probably just doing something dumb, but I am completely stuck...
public void actionPerformed(ActionEvent e){ UI.getInstance().sS++;
if((UI.getInstance().sS %2) != 0){
UI.getInstance().startStop.setName("STOP");
UI.getInstance().change.setEnabled(false);
}else if(UI.getInstance().sS%2 == 0){
UI.getInstance().startStop.setName("START");
UI.getInstance().change.setEnabled(true);
}
}
public void setStartListener(StartHandler e){
this.startStop.addActionListener(e);
}
sS is an int that increments every time the button startStop is clicked. change is also a button.
© Stack Overflow or respective owner