Hi all, Even though I am SCJP, I have no idea about J2ME programming. I want to try this one out as well. So I have some problems. Could you please answer those. I have netBeans with me as the IDE. I have downloaded the wireless toolkit as well. I want to run a program. Atleast the "Hello world".
1) Where can I get the needed classes to write a mobile application. 2) Can I use netBeans to run the programs. If yes how can intergrate those classes to netBeans. 3) How to run the program. 4) Can I transfer it to my real phone and check it. If yes how Thank you very much for your time.
SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Zia Ahmed Shaikh
Greenhorn
Joined: Apr 10, 2004
Posts: 2
posted
0
Hi ; To develop ur first J2me application you only have to perform few taska. * click on KToolbar by selecting start menu > programs > J2me Wireless Toolkit > KToolbar. * click NEW PROJECT * give the name for ur project and click CREATE PROJECT.(there is no need of giving class name at this time if it is not available.) * now a directory structure has been created automatically. * place the following code in src folder of ur project (c:\wtk104\apps\YourProject\src\MyExample.java * //code starts import javax.microedition.midlet.*; import javax.microedition.lcdui.*;
public class HelloWorld extends MIDlet implements CommandListener { private Display display; private TextBox textBox; private Command quitCommand; public void startApp() { display = Display.getDisplay(this); quitCommand = new Command("Quit",Command.SCREEN,1); textBox = new TextBox("Hello World","My only first MIDlet",40,0); textBox.addCommand(quitCommand); textBox.setCommandListener(this); display.setCurrent(textBox); } public void pauseApp(){ } public void destroyApp(boolean uncontitional){ } public void commandAction(Command choice,Displayable displayable) { if(choice==quitCommand) { destroyApp(false); notifyDestroyed(); } } }
//*******program ends*******
* Now click on BUILD button on KToolbar window. * To run the application press RUN button enjoy it.... Email me if u face any problem or u need its explanation. Your friend Zia.