JAVA

프로그래밍 2009. 3. 26. 14:27


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

public class ButtonEx extends Jlet implements ActionListener
{
 Image img;
 ShellComponent shell = new ShellComponent();
 FormComponent form = new FormComponent();
 LabelComponent label = new LabelComponent("플레이어 준비중!!");
 ButtonComponent button1;
 ButtonComponent button2;
 
 protected void startApp(String args[])
 {
  try
  {
   img = Image.createImage("play.gif");
   button1 = new ButtonComponent(null,img);
   button1.setActionListener(this, null);

   img = Image.createImage("stop.gif");
   button2 = new ButtonComponent(null,img);
   button2.setActionListener(this, null);
   
   form.addComponent(label);
   form.addComponent(button1);
   form.addComponent(button2);

   form.setGab(10);

  }catch(IOException e){}

  shell.addComponent(form);
  shell.show();
 }
 public void action(Component c, Object o)
 {
  if(c == button1)
  {
   label.setLabel("플레이어 시작!");
  }

  if(c == button2)
  {
   label.setLabel("플레이어 멈춤!");
  }
 }
}

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

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
JAVA  (0) 2009.03.23
JAVA  (0) 2009.03.22
JAVA  (0) 2009.03.20
JAVA  (0) 2009.03.19
JAVA  (1) 2009.03.17

설정

트랙백

댓글