[´äº¯]ÅؽºÆ®ÇʵåÀÇ ¹®ÀÚ¿­À» ÅؽºÆ® ¿¡¾î¸®¾î·Î ¿Å±â´Âµ¥¿ä...


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

±Û¾´ÀÌ :Á¶½ÅÁ¦ 1999³â 7¿ù 06ÀÏ 15:34:14

In Reply to: ÅؽºÆ®ÇʵåÀÇ ¹®ÀÚ¿­À» ÅؽºÆ® ¿¡¾î¸®¾î·Î ¿Å±â´Âµ¥¿ä... posted by ¹ÚÇö¾Æ on 1999³â 7¿ù 05ÀÏ 20:16:55:

import java.awt.*;
import java.awt.event.*;



class Test extends Frame implements TextListener{
TextField textfield;
TextArea textarea;


Test() {


setLayout(new BorderLayout());
TextField textfield = new TextField("hi"); <-- À̺κÐ
TextArea textarea = new TextArea(); <-- À̺κÐ
add(textfield, "North");
add(textarea, "Center");
textfield.addTextListener(this);


setSize(300,300);
doLayout();
setVisible(true);
}


public void textValueChanged(TextEvent e) {


String string = new String();
string = textfield.getText();
textarea.append(string);
}


public static void main(String args[]) {
new Test();
}
}


À§¿¡¼­ 'À̺κÐ'À̶ó°í Ç¥½ÃÇØ µÐ °÷ÀÌ ¹®Á¦ÁÒ...
textfield¿Í textareaÀÇ º¯¼ö¼±¾ðÀÌ ¹®Á¦°¡ µÈ ÇÁ·Î±×·¥À̳׿ä...
À§ ÇÁ·Î±×·¥À» º¸½Ã¸é
textfield, textarea¸¦ instance variable·Î ¼±¾ðÇØ ³õ°í »ý¼ºÀÚ ¸ðµâ ³»¿¡¼­
¶Ç textfield¿Í textarea º¯¼ö¸¦ ¸¸µé°Ô µÇ¸é º¯¼öÀÇ À¯È¿ ¿µ¿ªÀº »ý¼ºÀÚ ¸ðµâ ³»¿¡¼­¸¸
°¡´ÉÇÏ°Ô µÇ°ÚÁö¿ä..
±×·¯´Ï±î »ý¼ºÀÚ ¸ðµâ³»¿¡¼­ »õ·Ó°Ô TextField, TextArea°´Ã¼¸¦ °¡¸®Å°´Â °°Àº À̸§ÀÇ ·¹ÆÛ·±½º¸¦ ¸¸µé¸é
instance variableÀÇ textarea³ª textfield°¡ ±× °´Ã¼¸¦ °¡¸®Å°´Â °ÍÀÌ ¾Æ´Ï¶ó ¸ðµâ³»¿¡¼­
»õ·Î ¸¸µç textarea¿Í textfield °¡ °´Ã¼¸¦ °¡¸®Å²´Ù´Â °ÍÀÌÁö¿ä..


±×·¡¼­ textValueChanged ¸Þ¼Òµå¿¡¼­ getText() ¸Þ¼Òµå°¡ µ¿ÀÛÀ» ÇÏÁö ¸øÇÏ´Â °ÍÀÌÁÒ...
textValueChanged ¸ðµâÀÇ textfield¿Í textarea´Â ¾Æ¹«·± °´Ã¼µµ °¡¸®Å°°í ÀÖÁö ¸øÇÑ »óÅ´ϱî¿ä..


±×·¯´Ï±î ÇÁ·Î±×·¥ÀÇ »ý¼ºÀÚ ¸ðµâ¿¡ ÀÖ´Â


TextField textfield = new TextField("hi");
TextArea textarea = new TextArea();


¸¦ ¾Æ·¡¿Í °°ÀÌ ¹Ù²Ù¸é µÇÁÒ..


textfield = new TextField("hi");
textarea = new TextArea();





´ÙÀ½ ±Ûµé:



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

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
HTML ÅÂ±× Æ÷ÇÔ ¿©ºÎ: HTML ¹®¼­ÀÏ °æ¿ì üũ
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


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