글
JAVA
import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;
import java.io.IOException;
public class ImageEx extends Jlet implements CommandListener
{
ShellComponent shell = new ShellComponent();
CommandBarComponent combar = new CommandBarComponent();
ImageComponent img = new ImageComponent();
Command cmd1, cmd2;
Image image1, image2;
protected void startApp(String args[])
{
try
{
image1 = Image.createImage("play.gif");
image2 = Image.createImage("stop.gif");
}catch(IOException e){}
img.setImage("ani.gif");
img.setLayout(Component.LAYOUT_HCENTER | Component.LAYOUT_VCENTER);
cmd1 = new Command("시작", image1, cmd1);
cmd2 = new Command("정지", image2, cmd2);
combar.addCommand(cmd1);
combar.addCommand(cmd2);
combar.setCommandListener(this, null);
shell.addComponent(img);
shell.setCommand(combar, false);
shell.show();
}
protected void paseApp(){}
protected void resumeApp(){}
protected void destroyApp(boolean b){}
public void commandAction(Command c, int t, Object o)
{
if(c == cmd1 && t == SELECT)
img.play();
if(c == cmd2 && t == SELECT)
img.stop();
}
}