I'm sort of confused as to how to implement a FieldChangeListener in the Blackberry JDE. One way has me make my main class implement FieldChangeListener, and then have a fieldchanged method inside of it, and another has me do:
FieldChangeListener listenerUS = new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
System.out.println("Something changed!");
pushScreen(_newScreen);
}
};
Either way, if I try to call a method (like pushScreen, or a custom method I've written), I get a runtime error. In debug mode, none of my print statements are being displayed, either. However, if I remove the fieldChanged method outright, it won't even compile, so I"m pretty sure it's seeing the code?
I've added the listener to the button I want it hooked up to either by having:
but_temp.setChangeListener(this);
(in the first case) or by putting listenerUS.
Everything seems to be hooked up, but of my print statements show up, and if I call a method, I get a runtime error.
Does this make sense? Am I just completely confused about how to use listeners on the blackberry?
There's a copy of my code as a whole...