±Û¾´ÀÌ :À̽¹è 1998³â 1¿ù 18ÀÏ 13:16:47
Áö³¹ø¿¡ ¿Ã¸°°Å´Â ij½ºÆÃÀÌ ¹®Á¦°¡ ¾Æ´Ï¶ó..
c = a * b (*´Â ÀÓÀÇÀÇ ¿¬»ê±âÈ£ +³ª - * / µî..)À» ¾î¶»°Ô ÄÚµùÀ¸·Î ±¸ÇöÇÏ´À³Ä ¿´´Âµ¥¿ä.. ¾î·µç Áú¹®¿¡ ´ëÇÑ ´äº¯Àº Á¤¸» °¨»çµå¸³´Ï´Ù.
¶Ç Áú¹®Àä.
import java.awt.*;
import java.applet.*;
public class Test extends Applet
{
Frame CalFrame = new Frame("Hi~");
MenuBar MainMenu = new MenuBar();
Menu FileMenu = new Menu("File", true);
public void init()
{
CalFrame.resize(400, 400);
CalFrame.add(new Button("Test")); //ÀÌ°Ç ¶Ç ¿Ö ¾ÈµÅ³²? --
CalFrame.setMenuBar(MainMenu);
MainMenu.add(FileMenu);
FileMenu.add(new MenuItem("Exit"));
CalFrame.show();
}
public boolean handleEvent(Event e)
{
if(e.target instanceof Button)
{
if ((e.id == Event.ACTION_EVENT) && (e.target instanceof MenuItem))
{
if (((MenuItem)e.target).getLabel().equals("Exit"))
{
System.exit(0);
}
}
}
return false;
}
}
À§¿¡¿ä.. handleEvent¸Þ¼Òµå ¸»ÀÔ´Ï´Ù.