📄 currentthreaddemo.java~5~
字号:
//CurrentThreadDemo.javaimport java.lang.*;import java.util.*;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;public class CurrentThreadDemo extends MIDlet{ private Display display; public CurrentThreadDemo() { //display = Display.getDisplay(this); } protected void startApp() { //display.setCurrent(); try { Thread t = Thread.currentThread(); System.out.println("Current Thread: " + t.getName()); t.setPriority(3); System.out.println("After priority change: " + t); } catch (Exception e) { System.out.println(e.toString()); } try { for (int n = 5; n > 0; n--) { System.out.println(n); Thread.sleep(1000); } } catch (InterruptedException e) { System.out.println("Main thread interrputed"); } } protected void pauseApp(){} protected void destroyApp(boolean unconditional){}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -