Á¤È®ÇÑ Äڵ带 ´Ù½Ã ¿Ã¸³´Ï´Ù.


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

±Û¾´ÀÌ :±èÅÂÈÆ 1998³â 6¿ù 12ÀÏ 16:03:32

In Reply to: [Áú¹®] ÅÂÈÆ´Ô... Äڵ尡 Á¶±Ý Àß ¸ø µÈ°Å ¾Æ´Ñ°¡¿ä? posted by ÀÌÈñÁ¤ on 1998³â 6¿ù 12ÀÏ 14:47:42:


import java.awt.*;
import java.applet.*;



public class Applet1 extends Applet
{
public void init()
{
setLayout(null);
setSize(201,207);
button1 = new java.awt.Button();
button1.setLabel("button1");
button1.setBounds(24,36,72,36);
button1.setBackground(new Color(12632256));
add(button1);
button2 = new java.awt.Button();
button2.setLabel("button2");
button2.setBounds(108,36,72,36);
button2.setBackground(new Color(12632256));
add(button2);
button3 = new java.awt.Button();
button3.setLabel("button3");
button3.setBounds(24,84,72,36);
button3.setBackground(new Color(12632256));
add(button3);
button4 = new java.awt.Button();
button4.setLabel("button4");
button4.setBounds(108,84,72,36);
button4.setBackground(new Color(12632256));
add(button4);
textArea1 = new java.awt.TextArea("",0,0,TextArea.SCROLLBARS_NONE);
textArea1.setBounds(24,144,155,43);
add(textArea1);


//{{REGISTER_LISTENERS
SymFocus aSymFocus = new SymFocus();
button1.addFocusListener(aSymFocus);
button2.addFocusListener(aSymFocus);
button3.addFocusListener(aSymFocus);
button4.addFocusListener(aSymFocus);
//}}
}


//{{DECLARE_CONTROLS
java.awt.Button button1;
java.awt.Button button2;
java.awt.Button button3;
java.awt.Button button4;
java.awt.TextArea textArea1;
//}}



class SymFocus extends java.awt.event.FocusAdapter
{
public void focusGained(java.awt.event.FocusEvent event)
{
Object object = event.getSource();
if (object == button1)
button1_GotFocus(event);
else if (object == button2)
button2_GotFocus(event);
else if (object == button3)
button3_GotFocus(event);
else if (object == button4)
button4_GotFocus(event);
}
}



void button1_GotFocus(java.awt.event.FocusEvent event)
{
// to do: code goes here.
textArea1.setText("¹öÆ° 1¿¡ focus");
}



void button2_GotFocus(java.awt.event.FocusEvent event)
{
// to do: code goes here.
textArea1.setText("¹öÆ° 2¿¡ focus");
}



void button3_GotFocus(java.awt.event.FocusEvent event)
{
// to do: code goes here.
textArea1.setText("¹öÆ° 3¿¡ Æ÷Ä¿½º");
}



void button4_GotFocus(java.awt.event.FocusEvent event)
{
// to do: code goes here.
textArea1.setText("¹öÆ° 4¿¡ Æ÷Ä¿½º");
}



}



´ÙÀ½ ±Ûµé:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]