글
JAVA
import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;
public class ProgressEx extends Jlet implements ActionListener {
ShellComponent shell = new ShellComponent();
FormComponent form = new FormComponent();
ProgressComponent pro = new ProgressComponent(true, 100);
LabelComponent label = new LabelComponent("전송 준비중!!!");
ButtonComponent button = new ButtonComponent("전송하기", null);
protected void startApp(String args[]) {
button.setActionListener(this, null);
pro.setValue(0);
form.addComponent(label); form.addComponent(pro);
form.addComponent(button); form.setGab(5);
shell.addComponent(form);
shell.show();
}
protected void destroyApp(boolean b){}
public void action(Component c, Object o)
{
for(int i=0; i<=pro.getMaxValue(); i++)
{
pro.setValue(i);
label.setLabel(pro.getValue() + "% 진행완료");
try
{
Thread.sleep(200);
}catch(InterruptedException e){}
//화면의 내용을 갱신
shell.repaint();
//갱신된 내용을 즉시 화면에 출력
shell.serviceRepaints();
}
LabelComponent label = new LabelComponent("전송 완료" );
DialogComponent dialog = new DialogComponent(label, "Imformaiton", DialogComponent.TYPE_OK);
dialog.doModal();
label.setLabel("전송 준비중!!!!");
pro.setValue(0);
}
}