Sunday, July 4, 2010

LWUIT: Radio Button




import javax.microedition.midlet.*;
import com.sun.lwuit.*;
import com.sun.lwuit.events.*;

public class Hello_LWUIT extends MIDlet implements ActionListener {
public void startApp() {
Display.init(this);
Form f = new Form("Hello, MIDlet in LWUIT!");
f.show();
Command exitCommand = new Command("Exit");
f.addCommand(exitCommand);
f.setCommandListener(this);

RadioButton radioButton_1 = new RadioButton("Radio Button 1");
RadioButton radioButton_2 = new RadioButton("Radio Button 2");
RadioButton radioButton_3 = new RadioButton("Radio Button 3");

f.addComponent(radioButton_1);
f.addComponent(radioButton_2);
f.addComponent(radioButton_3);

}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void actionPerformed(ActionEvent ae) {
notifyDestroyed();
}
}