Will J2ME operating procedures End simulator running on how the case is closed? Thank you
Abstract: Will J2ME operating procedures End simulator running on how the case is closed? Thank you
Younger brother beginner J2ME, wrote a small program operating procedures, shut down automatically simulator is how matter? Thank you ~ ~
Not in the Chinese directory, the code below:
Package com.j2medev.netbeans;
Import java.io.ByteArrayOutputStream;
Import java.io.IOException;
Import java.io.InputStream;
Import javax.microedition.midlet .*;
Import javax.microedition.lcdui .*;
Public class TurboMidlet extends MIDlet implements CommandListener (
Private Display display = null;
Private Form mainForm = null;
Public static final Command exitCommand = new Command ( "Exit", Command.OK, 1);
/ / StartApp () method is the entrance procedures, or java applications in the main () method
Public void startApp () (
If (display == null) (
Display = Display.getDisplay (this);
)
MainForm = new Form ( "TurboMIDlet");
Image img = getImage ( "JavaPowered-8.png");
MainForm.append (img);
String text = "";
Try (
Text = getText ( "j2medev.txt");
) Catch (IOException ex) (
Text = "text read error";
)
MainForm.append ( "/ n" + text);
MainForm.addCommand (exitCommand);
MainForm.setCommandListener (this);
/ / MainForm set to the screen showed that the current targets
Display.setCurrent (mainForm);
)
Private Image getImage (String name) (
Image img = null;
Try (
/ / Read the picture images directory
Img = Image.createImage ( "/ images /" + name);
) Catch (IOException ex) (
Ex.printStackTrace ();
)
Return img;
)
Private String getText (String name) throws IOException (
/ / Resources documents, such as picture and text, and java-related best way
InputStream is = getClass (). GetResourceAsStream ( "/ text /" + name);
If (is! = Null) (
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
Int ch = 0;
/ / The contents of text files will be written to the memory baos open
While ((ch = is.read ())! = -1) (
Baos.write (ch);
)
/ / Copy the contents of the documents to return to the array of bytes
Byte [] = baos.toByteArray text ();
Baos.close ();
/ / Because includes Chinese, transcoding for UTF-8
Return new String (text, "UTF-8");
Else ()
Return null;
)
)
Public void pauseApp () (
/ / In this case no treatment
)
Public void destroyApp (boolean unconditional) (
/ / In this case no treatment
)
Public void commandAction (Command cmd, Displayable displayable) (
If (cmd == exitCommand) (
DestroyApp (false);
NotifyDestroyed ();
)
)
)
Tools NetBeans eclipse the same, thank you! ! ! !
If (display == null) (
Display = Display.getDisplay (this);
)
Here to judge how ah? Is not here ah
The simulator then you see what is the ah. May be memory problems, may also be the picture, too. You look at the external operation simulator good to bad!
Also read of your subject, I would like to ask is in the process simulator End clearance operation, or in the process of customs clearance operation ah?
Running finished on the closure of the Kazakhstan
"The simulator then you see what is the ah. May be memory problems, may also be the picture, too. You look at the external operation simulator good to bad!" What does that mean ah? How in the external operation simulator? Thank you!
A number of other projects, too, is on the code, the project into NetBeans or eclipse after an operation like this, Operation End automatically closed.
This is the simulator you the right to shut down automatically, look at the exit procedures after what was wrong, may be useful.
External simulator is in the menu you wtk Run MIDP Application options can be loaded *. jad documents, mobile phone operation procedures.
Please check the landlord is "running End shut down automatically" or "no operation at all procedures directly closed."
If it is the "process is not running directly off", I may know why * _ *
Anyway, the error is not running, pop-up on the simulator may be imprisoned for one second! ! !
I QQ: 101022104, thank you all! ! !
"You wtk external simulator is in the menu Run MIDP Application options can be loaded *. jad documents, mobile phone operation procedures." Can run C: / WTK22/apps projects under the A, to the copies of this directory nor to Kazakhstan ~ ~ ~ simply can not afford to run! ! !
I have encountered this problem, as long as the C: / WTK22/apps a directory of extensions. Utf deletion of a document on the line
> Anyway, the error is not running, pop-up on the simulator may be imprisoned for one second! ! !
Evidently, with the landlord in all likelihood I encountered the same problem _ * *
I encountered problems phenomenon is the case, why is the time when running MIDlet, did not pass their exit procedures, but the simulator click the power button directly related to the simulator. Thus, in this MIDlet residue on the simulator. MIDlet running next time, IDE will say "simulator has been installed in a similar MIDlet," and thus refused to implement. The solution was to use OTA settings tools MIDlet unloading.
Buster upstairs, the trouble you can say in detail how and unloading points?
Directly in the simulator is deleted? I deleted the only one "should be in accordance with procedures Yun" (this cut can not), but is not ah ~ ~ ~ ~ is how matter ah?
I use the Sun's Wireless Toolkit 2.2, with Windows 2000, through OTA Provisioning start. You should delete that, the last only "setup application."
However, with a four WTK simulator, which uses the folder is different. You have passed Default Device Selection to set used by the simulator, and then run OTA Provisioning.
If alone is not enough, then I am afraid this is not the reason; p
Not whether the work? Have to change jobs? I find, pay for:
Location: Beijing High JAVA procedures, the development of more than three years experience in JAVA (J2EE, EJB, systems design and analysis)
Contact: e-mail guagua2008@tom.com soon have someone contact you
Run:
Starting emulator in execution mode
Through DefaultColorPhone to run storage root domain name is not correct, please switch to the 'untrusted'
Java.lang.SecurityException: untrusted domain is not configured
At com.sun.midp.security.Permissions.forDomain (+98)
At com.sun.midp.dev.DevMIDletSuiteImpl.create (+39)
At com.sun.midp.dev.DevMIDletSuiteImpl.create (+62)
At com.sun.midp.main.Main.runLocalClass (+20)
At com.sun.midp.main.Main.main (+116)
Execution completed.
15,730 bytecodes executed
0 thread switches
738 classes in the system (including system classes)
Dynamic objects allocated 239 (15,592 bytes)
1 garbage collections (0 bytes collected)
Generation success (total time: 4 seconds)
What is the reason for this wrong?
Thank you all, to find the reasons, my user name is Chinese, it is this reason! ! !
↑ Back
Tags: Java procedures






