Porting from com.sun.kjava
The basics
- Instead of extending Spotlet you extend %JAVADOC{SW:waba.ui.MainWindow}%
- Instead of static main( String[] ) the method you use is onStart()
Dealing with Graphics.getGraphics()
One of the more common things I have seen in J2ME is the use of direct painting vs the use of Controls. While this can provide performance gains this operation is different in
SuperWaba. To use this code:
static Graphics g = Graphics.getGraphics();
You can easily change it to:
static Graphics g = MainWindow.getMainWindow().createGraphics();
This will allow you to have direct access to paint the screen.
Converting containers size and position
J2me allows you to specify x,y coordinates for a control. Like:
Button b = new Button( "Some Text", x, y);
In
SuperWaba, the control must be added to its container before it can be sized so you need to do the following:
Button b = new Button("Some Text");
add(b);
b.setRect(x,y,PREFERRED,PREFERRED);
or
Button b = new Button("Some Text");
add(b,x,y);
--
IanGeiser - 02 Apr 2004