JAVA

프로그래밍 2009. 4. 10. 14:37

import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;
import java.io.IOException;

public class CommandEx extends Jlet implements CommandListener {
 ShellComponent shell = new ShellComponent();

 CommandBarComponent combar = new CommandBarComponent();

 Image image1, image2, image3;
 Command cmd1, cmd2, cmd3;
 
 protected void startApp(String args[]) {
  try
  {
   image1 = Image.createImage("star.gif");
   image2 = Image.createImage("circle.gif");
   image3 = Image.createImage("cancel.gif");
  }catch(IOException e){}
  cmd1 = new Command("별",image1, cmd1);
  cmd2 = new Command("원",image2, cmd2);
  cmd3 = new Command("취소",image3, cmd3);

  combar.addCommand(cmd1);
  combar.addCommand(cmd2);
  combar.addCommand(cmd3);
  
  combar.setCommandListener(this, null);

  shell.setCommand(combar, false);
  shell.show();
 }

 protected void destroyApp(boolean b){}
 public void commandAction(Command c, int t, Object o)
 {
  if(c == cmd1 && t == SELECT)
  {
   LabelComponent label = new LabelComponent(null, image1);
   DialogComponent dialog = new DialogComponent(label, "별 모양 선택", DialogComponent.TYPE_NONE);
   dialog.setTimeout(2000);
   dialog.doModal();
  }

  if(c == cmd2 && t == SELECT)
  {
   LabelComponent label = new LabelComponent(null, image2);
   DialogComponent dialog = new DialogComponent(label, "원 모양 선택", DialogComponent.TYPE_OK);
   dialog.doModal();
  }
  if(c == cmd3 && t == SELECT)
  {
   LabelComponent label = new LabelComponent(null, image3);
   DialogComponent dialog = new DialogComponent(label, "취소 선택", DialogComponent.TYPE_NONE);
   dialog.setTimeout(2000);
   dialog.doModal();
  }
 }
}

 



'프로그래밍' 카테고리의 다른 글

JAVA  (1) 2009.04.20
JAVA  (0) 2009.04.19
JAVA  (0) 2009.04.16
JAVA  (1) 2009.04.15
JAVA  (0) 2009.04.12
JAVA  (0) 2009.04.07
JAVA  (0) 2009.04.04
JAVA  (0) 2009.04.03
JAVA  (0) 2009.03.31
JAVA  (2) 2009.03.27

설정

트랙백

댓글