Here's an example, from A to Z, in 10 minutes:
Go to C:\WTK22\bin and start ktoolbar.bat
Create a new project name "BasicMidlet" with Midlet class name "BasicMidlet", then hit "Create Project"
Next you have the Settings for your project displayed - take the defaults "Ok"
In the directory, a structure was created that looks like:
C:\WTK22\apps\BasicMidlet\
\bin
\lib
\res
\src
project.properties
Save the following file as "BasicMidlet.java" in a directory like C:\WTK22\apps\BasicMidlet\
This is where you might use JBuilder to create the file, but it's not absolutely necessary. Notepad works just fine too.
**************************
import javax.microedition.midlet.
import javax.microedition.lcdui.*
public class BasicMidlet extends MIDlet implements CommandListener {
private Command exitCommand;
private TextBox tbox;
public BasicMidlet() {
exitCommand = new Command("Exit", Command.EXIT, 1);
tbox = new TextBox("Eureka", "It works!", 25, 0);
tbox.addCommand(exitComman
tbox.setCommandListener(th
}
protected void startApp() {
Display.getDisplay(this).s
}
protected void pauseApp() {}
protected void destroyApp(boolean bool) {}
public void commandAction(Command cmd, Displayable disp) {
if (cmd == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
**************************
On the KToolbar, click "Build". The midlet should compile successfully ("Build completed.")
On the KToolbar, click "Run". The midlet should display on the emulator device, then click "Launch" on the emulator and you'll get the output "It works!" on the device.
If you want to deploy it on a real device, select "Project > Package > Create Package". In C:\WTK22\apps\BasicMidlet\
Keep in mind the WTK has done a great deal of work for us behind the scenes.
Hope this helps get you rolling.
Main Topics
Browse All Topics





by: sergeiweerasuriyaPosted on 2006-01-17 at 18:18:30ID: 15725403
Oh one more thing......at home i have no problem of running this coz i use Eclipse 3.0. But at the university they dont have Eclipse and we cannot install it. What they have is JBuilder (not the Mobile Studio) and the Wireless toolkit. The lecturer said we can write the MIDlet in JBuilder and compile it but dont RUN it. Then RUN it from the Wireless toolkit. I haven't got a clue how to do this. If it's possible i'd rather use an editor like notepad.