当前位置: 技术问答>java相关
加图片问题,我想在警告时加一个图片,程序如下,但我的图片出不来,各位高手帮帮忙
来源: 互联网 发布时间:2015-11-16
本文导语: 我的代码如下,我把图片放在res文件夹中,可运行后图片显示不出来。 package alert.test; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class AlertTypesDemo extends MIDlet implements CommandListener { private Display...
我的代码如下,我把图片放在res文件夹中,可运行后图片显示不出来。
package alert.test;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class AlertTypesDemo extends MIDlet implements CommandListener
{
private Display display;
private List menu;
private static final int TIMEOUT=5;
private AlertThread[] alerts={
new AlertThread("ALARM","Alert.ALARM","alarm",AlertType.ALARM,TIMEOUT),
new AlertThread("ALARM(M)","Alert.ALARM","alarm",AlertType.ALARM,Alert.FOREVER),
new AlertThread("CONFIRMATION","Alert.CONFIRMATION","confirmation",AlertType.CONFIRMATION,TIMEOUT),
new AlertThread("CONFIRMATION(M)","Alert.CONFIRMATION","confirmation",AlertType.CONFIRMATION,Alert.FOREVER),
new AlertThread("ERROR","Alert.ERROR","error",AlertType.ERROR,TIMEOUT),
new AlertThread("ERROR(M)","Alert.ERROR","error",AlertType.ERROR,Alert.FOREVER),
new AlertThread("INFO","Alert.INFO","information",AlertType.INFO,TIMEOUT),
new AlertThread("INFO(M)","Alert.INFO","information",AlertType.INFO,Alert.FOREVER),
new AlertThread("WARNING","Alert.WARNING","warning",AlertType.WARNING,TIMEOUT),
new AlertThread("WARNING(M)","Alert.WARNING","warning",AlertType.WARNING,Alert.FOREVER),
};
public void startApp()
{
display=Display.getDisplay(this);
menu=new List("Alerts",List.IMPLICIT);
for(int i=0;i=0)&&(ix
package alert.test;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class AlertTypesDemo extends MIDlet implements CommandListener
{
private Display display;
private List menu;
private static final int TIMEOUT=5;
private AlertThread[] alerts={
new AlertThread("ALARM","Alert.ALARM","alarm",AlertType.ALARM,TIMEOUT),
new AlertThread("ALARM(M)","Alert.ALARM","alarm",AlertType.ALARM,Alert.FOREVER),
new AlertThread("CONFIRMATION","Alert.CONFIRMATION","confirmation",AlertType.CONFIRMATION,TIMEOUT),
new AlertThread("CONFIRMATION(M)","Alert.CONFIRMATION","confirmation",AlertType.CONFIRMATION,Alert.FOREVER),
new AlertThread("ERROR","Alert.ERROR","error",AlertType.ERROR,TIMEOUT),
new AlertThread("ERROR(M)","Alert.ERROR","error",AlertType.ERROR,Alert.FOREVER),
new AlertThread("INFO","Alert.INFO","information",AlertType.INFO,TIMEOUT),
new AlertThread("INFO(M)","Alert.INFO","information",AlertType.INFO,Alert.FOREVER),
new AlertThread("WARNING","Alert.WARNING","warning",AlertType.WARNING,TIMEOUT),
new AlertThread("WARNING(M)","Alert.WARNING","warning",AlertType.WARNING,Alert.FOREVER),
};
public void startApp()
{
display=Display.getDisplay(this);
menu=new List("Alerts",List.IMPLICIT);
for(int i=0;i=0)&&(ix