import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class FormScroll extends MIDlet implements CommandListener
{
private Display display; // Reference untuk display object
private Form frmMain; // main form
private Command cmdExit; // Command exit
private TextField txfSize; // textfield
private ChoiceGroup chgEmail; // Choice group
private Gauge gauVolume; // Volume
public FormScroll()
{
display = Display.getDisplay(this);
// membuat TextField
txfSize = new TextField("Size", "Large", 5, TextField.ANY);
// membuat choice group, dan append data masukan yg dapat dipilih nanti
chgEmail = new ChoiceGroup("Email Options", Choice.EXCLUSIVE);
chgEmail.append("Read", null);
chgEmail.append("Forward", null);
chgEmail.append("Delete", null);
// membuat gauge
gauVolume = new Gauge("Sound Level", true, 30, 4);
cmdExit = new Command("Exit", Command.EXIT, 1);
// membuat form
frmMain = new Form("Form Stuff");
frmMain.append(txfSize);
frmMain.append(chgEmail);
frmMain.append(gauVolume);
frmMain.addCommand(cmdExit);
// events
frmMain.setCommandListener(this);
}
// memanggil application manager untuk memulai MIDlet.
public void startApp()
{
display.setCurrent(frmMain);
}
public void pauseApp()
{ }
public void destroyApp(boolean unconditional)
{ }
public void commandAction(Command c, Displayable s)
{
if (c == cmdExit)
{
destroyApp(false);
notifyDestroyed();
}
}
}
sumber : www.java2s.com
print out :
Senin, 17 Mei 2010
Langganan:
Posting Komentar (Atom)
Pengikut
Category
- B.indonesia (26)
- cyber crime (8)
- cyber law (1)
- Database (1)
- Grafik (2)
- it audit (1)
- jaringan (4)
- nasional (1)
- Pemograman (2)
- Pemrograman Java (8)
- Pengelolaan Proyek Sistem Informasi (2)
- sosial (2)
- Telematika (2)
0 komentar:
Posting Komentar