<!–
amazon_ad_tag=”ic0a6-20″;
amazon_ad_width=”728″;
amazon_ad_height=”90″;
amazon_color_border=”206BA2″;
amazon_color_logo=”FFFFFF”;
amazon_color_link=”206BA2″;
amazon_ad_logo=”hide”;
amazon_ad_title=”Toko Online”; //–>
importjavax.microedition.lcdui.*;
import java.io.*;
import java.io.*;
public class ReadFile
extends Form
implements CommandListener {
private ReadFileTextmidlet;
private Display display;
private Command cmExit;
private String help;
private StringItemsi;
extends Form
implements CommandListener {
private ReadFileTextmidlet;
private Display display;
private Command cmExit;
private String help;
private StringItemsi;
publicReadFile(ReadFileTextmidlet, Display
display) {
super(“Read File Text”);
this.midlet = midlet;
this.display = display;
super(“Read File Text”);
this.midlet = midlet;
this.display = display;
if ((help = readHelpText()) != null) {
si = new StringItem(“”, help);
} else
si = new StringItem(“Error”, “File Help TidakDitemukan”);
si = new StringItem(“”, help);
} else
si = new StringItem(“Error”, “File Help TidakDitemukan”);
append(si);
cmExit = new Command(“Keluar”, Command.EXIT,
1);
setCommandListener(this);
addCommand(cmExit);
}
setCommandListener(this);
addCommand(cmExit);
}
public void commandAction(Command c,
Displayable s) {
if (c == cmExit)
midlet.exitMIDlet();
}
if (c == cmExit)
midlet.exitMIDlet();
}
private String readHelpText() {
InputStream is = getClass().getResourceAsStream(“help.txt”);
try {
StringBuffersb = new StringBuffer();
intchr, i = 0;
while ((chr = is.read()) != -1)
sb.append((char) chr);
return sb.toString();
} catch (Exception e) {
}
return null;
}
};
InputStream is = getClass().getResourceAsStream(“help.txt”);
try {
StringBuffersb = new StringBuffer();
intchr, i = 0;
while ((chr = is.read()) != -1)
sb.append((char) chr);
return sb.toString();
} catch (Exception e) {
}
return null;
}
};
ReadFileText.java
importjavax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.*;
public class ReadFileText
extends MIDlet {
extends MIDlet {
Display display;
ReadFile read;
ReadFile read;
publicReadFileText() {
display = Display.getDisplay(this);
}
display = Display.getDisplay(this);
}
public void startApp() {
read = new ReadFile(this, display);
display.setCurrent(read);
}
read = new ReadFile(this, display);
display.setCurrent(read);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional)
{
}
}
public void exitMIDlet() {
destroyApp(false);
notifyDestroyed();
}
};
destroyApp(false);
notifyDestroyed();
}
};
siap di coba nih :)
BalasHapusmoga work ;)