?? welcome.java
字號:
package pass;
import javax.microedition.lcdui.*;
public class welcome extends Canvas implements Runnable {
Image welcome;
Thread thread=null;
int endw=1;
int twid,thei;
mypass tmain;
Display display;
public welcome(mypass main) {
try {
tmain=main;
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
display=Display.getDisplay(tmain);
welcome=Image.createImage("/welcome.png");
thread=new Thread(this);
thread.start();
}
public void run() {
while(true)
{
try {
thread.sleep(50);
}
catch (InterruptedException ex) {
}
if(endw<=twid-3)
{
endw++;
repaint();
}
else
{
passmain();
break;
}
}
}
protected void paint(Graphics g) {
twid=g.getClipWidth();
thei=g.getClipHeight();
g.setColor(255,255,255);
g.fillRect(0,0,twid,thei);
g.drawImage(welcome,0,0,g.LEFT | g.TOP);
g.setColor(0,0,0);
g.drawString("Loading..",2,thei-30,g.LEFT | g.TOP);
g.setColor(27,22,225);
g.fillRect(1,thei-15,endw-1,8);
}
private void passmain()
{
int i;
setpass displayable = new setpass(tmain);
login displayable1 = new login(tmain);
RecordSet first = new RecordSet();
first.open("userpass",true);
i=first.Recordcount();
first.close();
if(i==0)
display.setCurrent(displayable);
else
display.setCurrent(displayable1);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -