package com.j2medev.numbergame;
import java.io.ioexception;
import javax.microedition.lcdui.display;
import javax.microedition.lcdui.graphics;
import javax.microedition.lcdui.image;
public class splashscreen extends numscreen
{
public splashscreen(display display,manager next)
{
super(display, next);
}
protected void paint(graphics arg0)
{
image welcome = null;
try
{
welcome = image.createimage("/welcome.png");
} catch (ioexception e)
{
e.printstacktrace();
}
arg0.drawimage(welcome, 2, 2, graphics.top graphics.left);
}
}
package com.j2medev.numbergame;
import java.io.ioexception;
import javax.microedition.lcdui.display;
import javax.microedition.lcdui.graphics;
import javax.microedition.lcdui.image;
public class congscreen extends numscreen
{
private string title;
private mark mark;
private image image;
private image star;
private manager manager;
private int type = cong;
public static final int cong = 1;
public static final int warning = 2;
public congscreen(display display, manager next)
{
super(display, next);
}
public congscreen(display display,manager next, mark mark)
{
this(display, next);
this.mark = mark;
}
protected void paint(graphics g)
{
int width = this.getwidth();
int height = this.getheight();
if (image == null)
{
try
{
image = image.createimage("/cong.png");
star = image.createimage("/star.png");
} catch (ioexception e)
{
e.printstacktrace();
}
}
if (title != null)
{
g.drawstring(title, width / 2, 5, graphics.hcenter graphics.top);
}
int offset = 10 + getfont().getheight();
g.drawimage(image, 2, offset, graphics.top graphics.left);
offset = offset + image.getheight();
if(type == cong)
{
int number = 5 - mark.getcount()/2;
if(number ==0) number = 1;
g.drawstring("成绩:",2,offset+3,graphics.topgraphics.left);
for(int i = 0;i<number;i++)
{
g.drawimage(star,4+font.stringwidth("成绩:")+i*star.getwidth(),offset+3,graphics.leftgraphics.top);
}
}
}
public void settype(int type)
{
this.type = type;
}
public string gettitle()
{
return title;
}
public void settitle(string title)
{
this.title = title;
}
public mark getmark()
{
return mark;
}
public void setmark(mark mark)
{
this.mark = mark;
}
}
[1] [2] 下一页
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器