(http://na.blackberry.com/eng/developers/javaappdev/javadevenv.jsp)
Pour la validation et le test de vos applications vous pouvez utiliser le simulateur disponible aussi sur le site de BlackBery.
Voiçi un Exemple Simple :
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.component.*;
public class HelloWorld extends UiApplication
{
private MainScreen _screen;
private ButtonField _nextScreen;
public static void main(String[] args)
{
HelloWorld instance = new HelloWorld();
instance.enterEventDispatcher();
}
public HelloWorld()
{
_screen = new MainScreen();
_nextScreen = new ButtonField("Go to Next Screen",ButtonField.FIELD_HCENTER | ButtonField.CONSUME_CLICK);
_nextScreen.setChangeListener(new FieldChangeListener()
{
public void fieldChanged(Field field,int context)
{
pushScreen(new NextScreen());
}
});
_screen.setTitle(new LabelField("Hello World Demo",LabelField.USE_ALL_WIDTH));
_screen.add(new RichTextField("Hello to the BlackBerry World!",Field.NON_FOCUSABLE));
_screen.add(_nextScreen);
pushScreen(_screen);
}
}
class NextScreen extends MainScreen
{
public NextScreen()
{
setTitle(new LabelField("Second Screen !",LabelField.USE_ALL_WIDTH));
add(new RichTextField("This is new screen",Field.NON_FOCUSABLE));
ButtonField _btnGoBack = new ButtonField("Go Back",ButtonField.FIELD_HCENTER | ButtonField.CONSUME_CLICK);
_btnGoBack.setChangeListener(new FieldChangeListener()
{
public void fieldChanged(Field field,int context)
{
UiApplication.getUiApplication().popScreen();
}
});
add(_btnGoBack);
}
}