HOME / ¹®¼°øÀ¯ / ¸®Æ÷Æ®/³í¹® / ±â¼ú°øÇÐ
0
0°ÇÀÇ Èı⺸±âGUI ÄÁÆ®·Ñ º¸°í¼¿¡ ´ëÇØ ±â¼úÇÑ ¸®Æ÷Æ® Âü°íÀÚ·áÀÔ´Ï´Ù.
1Àå ÅؽºÆ®Çʵå¿Í ÅؽºÆ®¿µ¿ª ÄÄÆ÷³ÍÆ®
2Àå ¸Þ´º
3Àå Æ˾÷¸Þ´º
4Àå À̹ÌÁö¾ÆÀÌÄÜ
5Àå ¶óµð¿À¹öÆ°
6Àå ±×·ì Ȧ´õ(Tabbed Pane)
ÀÚ¹ÙÇÁ·Î±×·¡¹Ö gui ÄÁÆ®·Ñ ii
1.ÅؽºÆ®Çʵå¿Í ÅؽºÆ®¿µ¿ª ÄÄÆ÷³ÍÆ®
textarea Ŭ·¡½º¿Í textfield Ŭ·¡½º´Â ¼±Åð¡´ÉÇÑ ÅؽºÆ®¸¦ µð½ºÇ÷¹ÀÌ ÇØ ÁÖ°í,
¼±ÅÃÀûÀ¸·Î »ç¿ëÀÚ°¡ ÅؽºÆ®¸¦ ÆíÁýÇÒ ¼ö ÀÖµµ·Ï ÇØ ÁÝ´Ï´Ù.
textarea Ŭ·¡½º¿Í textfield Ŭ·¡½º¸¦ »ó¼ÓÇÏ´Â ÇÏÀ§Å¬·¡½º¸¦ ÀÌ¿ëÇÏ¿© ÀÔ·ÂÇÒ ¶§
¹ß»ýÇÏ´Â ¿¡·¯¸¦ °Ë»çÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
´Ù¸¥ ÄÄÆ÷³ÍÆ®¿Í °°ÀÌ, ÅؽºÆ® ¿µ¿ª ÄÄÆ÷³ÍÆ®¿Í
ÅؽºÆ® Çʵå ÄÄÆ÷³ÍÆ®ÀÇ Àü°æ»ö, ¹è°æ»ö, Ä÷¯, ÆùÆ® µîÀ» ¼³Á¤ÇÒ ¼ö ÀÖÁö¸¸,
¿ÜÇü»ó ³ªÅ¸³ª´Â ¸ð¾çÀ» º¯È½Ãų ¼ö´Â ¾ø½À´Ï´Ù.
textarea Ŭ·¡½º¿Í textfield Ŭ·¡½º´Â textcomponent Ŭ·¡½ºÀÇ ÇÏÀ§Å¬·¡½º·Î¼,
ÅؽºÆ® ¼±ÅÃÀ» ¾ò°Å³ª ¼³Á¤ÇÏ°í, ÅؽºÆ® ÆíÁýÀ» °¡´ÉÇÏ°Ô Çϰųª ºÒ°¡´ÉÇÏ°Ô Çϱ⵵ ÇÏ°í,
¼±ÅÃµÈ ÅؽºÆ® ¶Ç´Â ¸ðµç ÅؽºÆ®¸¦ ¾ò°í, ¸¶Áö¸·À¸·Î ÅؽºÆ®¸¦ ¼³Á¤ÇÒ ¼ö ÀÖµµ·Ï ÇØ ÁÖ´Â
¸Þ¼ÒµåµéÀ» textcomponent Ŭ·¡½º·ÎºÎÅÍ »ó¼ÓÇÏ°í ÀÖ½À´Ï´Ù.
import java.awt.*; import javax.swing.*; class textcomponenttest extends jframe { public textcomponenttest() { panel p1, p2; textfield tf1, tf2, tf3, tf4; textarea textarea; p1 new panel(); add(north, p1); tf1 new textfield(); tf2 new textfield(, 30);
tf2.seteditable(false);
p1.add(tf1);
p1.add(tf2);
textarea new textarea(5, 30); textarea.settext(hello, world!\n); textarea.selectall(); textarea.append(hello, java!\n); textarea.insert(hello!\n, 0); add(center, textarea);
1.ÅؽºÆ®Çʵå¿Í ÅؽºÆ®¿µ¿ª ÄÄÆ÷³ÍÆ®
p2 new panel(); add(south, p2); tf3 new textfield(hello, world!);
tf3.select(1, 5);
tf4 new textfield(hello, world!, 30);
tf4.selectall();
p2.add(tf3);
p2.add(tf4);
system.out.println( tf1.getselectedtext(): tf1.getselectedtext());
system.out.println( tf2.getselectedtext(): tf2.getselectedtext());
system.out.println( tf3.getselectedtext(): tf3.getselectedtext()); (ÀÌÇÏ »ý·«)
¹ÞÀº º°Á¡
0/5
0°³ÀÇ º°Á¡
¹®¼°øÀ¯ ÀڷḦ µî·ÏÇØ ÁÖ¼¼¿ä.
¹®¼°øÀ¯ Æ÷ÀÎÆ®¿Í Çö±ÝÀ» µå¸³´Ï´Ù.
Æ÷ÀÎÆ® : ÀÚ·á 1°Ç´ç ÃÖ´ë 5,000P Áö±Þ
Çö±Ý : ÀÚ·á 1°Ç´ç ÃÖ´ë 2,000¿ø Áö±Þ