글
JAVA
import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;
public class DateEx extends Jlet implements ActionListener {
ShellComponent shell = new ShellComponent();
FormComponent form = new FormComponent();
ButtonComponent button = new ButtonComponent("모드 바꾸기", null);
DateFieldComponent date = new DateFieldComponent(DateFieldComponent.MODE_DATE);
protected void startApp(String args[]) {
button.setActionListener(this, null);
form.addComponent(date);
form.addComponent(button);
form.setGab(10);
shell.addComponent(form);
shell.show();
}
protected void destroyApp(boolean b){}
public void action(Component c, Object o) {
switch(date.getMode())
{
case DateFieldComponent.MODE_DATE:
date.setMode(DateFieldComponent.MODE_TIME_DATE);
break;
case DateFieldComponent.MODE_TIME_DATE:
date.setMode(DateFieldComponent.MODE_TIME);
break;
case DateFieldComponent.MODE_TIME:
date.setMode(DateFieldComponent.MODE_DATE);
break;
}
}
}