ÇÁ·Î±×·¡¹Ö

 3204, 152/161 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   ksbgenius
   (ÀÚ¹Ù)¾×¼ÇÀ̺¥Æ® °ü·Ã Áú¹®..

http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_programming&no=3015 [º¹»ç]


import java.awt.event.*;
import javax.swing.*;


class InterestTest extends JFrame{
        private JButton button;
        private JTextField t1, t2, t3;
        public InterestTest(){
                this.setSize(500,200);
                this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                this.setTitle("ÀÌÀÚ °è»ê±â");
                
                JLabel label1 = new JLabel("¿ø±ÝÀ» ÀÔ·ÂÇϽÿÀ.");
                JLabel label2 = new JLabel("ÀÌÀ²À» ÀÔ·ÂÇϽÿÀ.");
                                JPanel panel = new JPanel();
                t1 = new JTextField(5);
                t2 = new JTextField(5);
                t3 = new JTextField(20);
                button = new JButton("º¯È¯");
                button.addActionListener(new MyListener());
                panel.add(button);
                panel.add(label1);
                panel.add(label2);
                panel.add(t1);
                panel.add(t2);
                panel.add(t3);
                
                this.add(panel);
                this.setVisible(true);                
        }
        private class MyListener implements ActionListener{
                public void actionPerformed(ActionEvent e){
                        if(e.getSource() == button){
                         t3.setText("ÀÌÀÚ´Â ....");            <------------------ÀÌ ºÎºÐÀÌ ±Ã±ÝÇÕ´Ï´Ù.
                        }
                }
        }
}
public class Interest{
        public static void main(String[] args){
                InterestTest m = new InterestTest();
        }
}
À§ ÇÁ·Î±×·¥°ú °°ÀÌ
ÅؽºÆ® Çʵå t1,t2,t3°¡ ÀÖ°í, º¯È¯À̶ó´Â ¹öÆ° ÄÄÆ÷³ÍÆ®°¡ ÀÖ½À´Ï´Ù.
¸¸¾à t1¿¡ ¿ø±ÝÀ» t2¿¡ ÀÌÀ²À» ³Ö°í º¯È¯ ¹öÆ°À» ´©¸£¸é t3¿¡ ÀÌÀÚ°¡ ¾ó¸¶´Ù ¶ó´Â°ÍÀ» º¸ÀÌ°í ½ÍÀºµ¥..
Áö±Ý Á¦°¡ t3.setText("ÀÌÀÚ´Â....."); ÀÌ·¸°Ô ½á ³õÀº ºÎºÐÀÌ Àִµ¥ ¿©±â´Â ±×³É ÅؽºÆ®¸¦ ³ªÅ¸³»´Âµ¥
ÀÌ ºÎºÐ¿¡ ÀÌÀÚ¸¦ °è»êÇϱâ À§Çؼ­ t1 ¿ø±Ý°ú t2 ÀÌÀÚ¸¦ °öÇÑ °ÍÀ» ³ªÅ¸³»°í ½Í½À´Ï´Ù.


  Hit : 5591     Date : 2011/05/25 10:05



    
$Zero private class MyListener implements ActionListener{
public void actionPerformed(ActionEvent e){
if(e.getSource() == button){
double a = Double.parseDouble(t1.getText()); //¾ò¾î¿Â ¹®ÀÚ¿­À» ij½ºÆ®
double b = Double.parseDouble(t2.getText()); // À§¿Í µ¿ÀÏ
String total = "" + (a*b); // °è»êµÈ double°ªÀ» ¹®ÀÚ¿­·Î ij½ºÆ®

t3.setText(total); // ¼ÂÆÃ.
}
}
}

µµ¿òÀÌ µÇ¼Ì±æ.
2011/05/26  
$Zero º¯¼ö ¼±¾ðÀ» ÇÏÁö ¾Ê°í ÀνºÅϽº·Î ³ÖÀ» ¼öµµ ÀÖÁö¸¸, °¡µ¶¼ºÀ» À§ÇØ µû·Î º¯¼ö ¼±¾ðÀ» Çß½À´Ï´Ù.

º¯¼ö¼±¾ð ¾øÀÌ ±×³É ij½ºÆ®ÇÏÀÚ¸¶ÀÚ Àμö·Î Àü´ÞÇϼŵµ »ó°ü¾ø¾î¿ä .
2011/05/26  
ksbgenius °¨»çÇÕ´Ï´Ù.¤¾¤¾^^ 2011/05/26  
184     [re] C ¾ð¾î¸¦ ¹è¿ì´Âµ¥¿ä..¤Ì¤Ì     hkpco
09/07 5539
183   printf ·Î Ãâ·ÂÇÑ ³»¿ëÀ» ÆÄÀÏ·ÎÀúÀåÇÏ·Á¸é ¾î¶»°ÔÇؾßÇϳª¿ä..[5]     lwklwk
08/24 5539
182   c¾ð¾î¿¡¼­ »ö±òÀÖ´Â ¹®ÀÚ¿­À» Ãâ·ÂÇÏ´Â ¹æ¹ý[2]     powermilk
05/20 5548
181   C++ ÇÔ¼ö ¿À¹ö·Îµù ¿À·ù Áú¹®ÀÔ´Ï´Ù. [1]     sweetick
03/04 5556
180   c¾ð¾îÀÇ Á߿伺¿¡ ´ëÇؼ­ Áú¹®[6]     yonggari306
10/15 5576
179   c¾ð¾î ¹é±×¶ó¿îµå µ¿ÀÛ..[2]     ³»°ø³È³È
01/02 5576
178   ¼ôÄÚµù ±â¹ý¿¡ °üÇØ...[2]     asa05
04/09 5577
  (ÀÚ¹Ù)¾×¼ÇÀ̺¥Æ® °ü·Ã Áú¹®..[3]     ksbgenius
05/25 5590
176   JAVA[ÀÚ¹Ù] ¾ð¾î Ã¥ Ãßõ ºÎŹµå¸³´Ï´Ù.[4]     ERIC910903
04/10 5599
175     [re] ¼ÒÄÏÇÃ¹Ö WSAEINTR 10004 ¿¡·¯ Äڵ忡¿è[7]     commio
09/06 5600
174   À©µµ¿ì7¿¡¼­ Åͺ¸c ¸»Àä[3]     gkswls123
10/18 5612
173   C¾ð¾î¹è¿ì´ÂÁßÀε¥..[5]     ¤Ñ.¤Ñ
09/05 5625
172   °ÔÀÓÇÙÀ̳ª ´Ù¿îÇÙ(Ŭ·´¹Ú½º,´ÙÀÌÇϵåµî À¯ÇàÇÞ´ø)ÀÇ ¿ø¸®´Â ¹«¾ùÀΰ¡¿ä?[2]     kumi123
09/10 5636
171   À©µµ¿ì¿ë gcc³ª À©µµ¿ì¿ëcÄÄÆÄÀÏ·¯°¡ ÀÕ³ª¿ä???Åͺ¸¾¾¸»°í¿©[6]     Ä«ÀÌÀú9
11/19 5639
170   [ÀÚ¹Ù] String Çü½Ä ¿À·ù ÀÔ´Ï´Ù[7]     Çܺ¸Ä­²ÊÂîÂÞ
11/10 5684
169   1ºÎÅÍ 100±îÁöÀÇ °ö¿¡ ´ëÇÑ ÀÚ·áÇü ¹®Á¨µ¥¿ä...¤Ð¤Ð[3]     gmlthd0908
12/06 5705
168   DLL ÀÎÁ§¼ÇÀÌ ¹ºÁö ¾Ë°í ½Í¾î¿ä.[1]     asdzxc301
11/21 5712
167   unp.h ÀÖ´Â °÷ÀÌ...[1]     JeDIY
10/29 5723
166   [c]Èü ¼¼±×¸ÕÆ®¿Í ½ºÅà ¼¼±×¸ÕÆ®[5]     asdwho
03/21 5739
165   [C¾ð¾î] redefinition of struck flock ¿¡·¯[3]     kalon
11/22 5766
[1]..[151] 152 [153][154][155][156][157][158][159][160]..[161]

Copyright 1999-2024 Zeroboard / skin by Hackerschool.org / Secure Patch by Hackerschool.org