상세 컨텐츠

본문 제목

TickerComponent

청강컴정/소프트웨어공학

by luckey 2009. 4. 6. 12:21

본문



import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;
import org.kwis.msp.handset.BackLight;

public class exam_090406 extends Jlet implements ActionListener
{
 ShellComponent shell = new ShellComponent();
 FormComponent form = new FormComponent();
 ButtonComponent button1 = new ButtonComponent("시작", null);
 ButtonComponent button2 = new ButtonComponent("정지", null);
 TickerComponent ticker = new TickerComponent("  2009년 4월 5일 메시지 출력 테스트", null);

 protected void startApp(String[] args)
 {
  BackLight.alwaysOn();
  button1.setActionListener(this, null);
  button2.setActionListener(this, null);
  form.addComponent(ticker);
  form.addComponent(button1);
  form.addComponent(button2);
  form.setGab(10);
  ticker.setTickerState(false);

  shell.addComponent(form);
  shell.show();
  
  ticker.setDelay(300);
 }

 protected void resumeApp(){};
 protected void pauseApp(){};
 protected void destroyApp(boolean b){};

 public void action(Component c, Object o)
 {
  if(c == button1)
  {
   ticker.setTickerState(true);
  }
  else if(c == button2)
  {
   ticker.setTickerState(false);
  }
 }
}

관련글 더보기

댓글 영역