검색결과 리스트
전체 글에 해당되는 글 238건
- 2009.03.26 JAVA
글
JAVA
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("플레이어 멈춤!");
}
}
}