J2me制作会动的波浪字体方法及代码
百度广告
public class DrawCanvas extends MIDlet implements CommandListener {
private HCanvas sg;
exitCommand = new Command("Exit", Command.EXIT, 1);
sg.addCommand(exitCommand);
Display.getDisplay(this).setCurrent(sg);
}
}
}
}
if (c == exitCommand) {
notifyDestroyed();
}
class HCanvas extends Canvas implements Runnable{
private String str=new String("PRESS 5");
boolean kaishi=true;
public HCanvas (){
}
protected void paint(Graphics g){
g.fillRect(0,0,getWidth(),getHeight());
for(int i=0;i< str.length();i++){
g.drawString(str.substring(i,i+1),21+i*7,11-ak[k-i],0);//加重字体7是字体宽度
}
while(kaishi){
repaint(); //再描绘
k++;
(ak.length-1)) k=6;
catch(InterruptedException e){}
}
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>