2
edits
Changes
no edit summary
}
</source>
The app has the MyApp class completed and it looks like:
<source lang="java">
package mypackage;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.ButtonField;
public class MyApp extends UiApplication {
private MyScreen _screen;
private ButtonField _nextScreenButton;
public static void main(String[] args) {
MyApp theApp = new MyApp();
theApp.enterEventDispatcher();
}
public MyApp() {
// Push a screen onto the UI stack for rendering.
_screen = new MyScreen();
_nextScreenButton = new ButtonField("Go to Next Screen",
ButtonField.FIELD_HCENTER | ButtonField.CONSUME_CLICK);
_nextScreenButton.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
pushScreen(new NextScreen());
}
});
_screen.add(_nextScreenButton);
pushScreen(_screen);
}
}
</source>
-----------------