<div>TextField 에서 getText() 의 default 값이 뭔가요?</div> <div>null 도 아니고, "" 도 아닌거같은데요....아오...</div> <div> </div> <div>밑에 코드로 실험해봤지만 안되네요..</div> <div> </div> <div> </div> <div><span style="color: blue">import</span> java.awt.*; <br /><span style="color: blue">import</span> java.awt.event.*; <br /><br /><span style="color: blue">class</span> Test <span style="color: blue">extends</span> Frame <span style="color: blue">implements</span> ActionListener { <br /> TextField tf; <br /> Button b; <br /> <br /> Test(String title) { <br /> <span style="color: blue">super</span>(title); <br /> addWindowListener(<span style="color: blue">new</span> WindowAdapter() { <br /> <span style="color: blue">public</span> <span style="color: blue">void</span> windowClosing(WindowEvent we) { <br /> System.exit(<span style="color: maroon">0</span>); <br /> } <br /> }); <br /> <br /> tf = <span style="color: blue">new</span> TextField(<span style="color: maroon">20</span>); <br /> b = <span style="color: blue">new</span> Button(<span style="color: maroon">"클릭"</span>); <br /> tf.addActionListener(<span style="color: blue">this</span>); <br /> b.addActionListener(<span style="color: blue">this</span>); <br /> <br /> add(tf, <span style="color: maroon">"Center"</span>); <br /> add(b, <span style="color: maroon">"South"</span>); <br /> <br /> setBounds(<span style="color: maroon">200</span>, <span style="color: maroon">100</span>, <span style="color: maroon">500</span>, <span style="color: maroon">500</span>); <br /> setVisible(<span style="color: maroon">true</span>); <br /> } <br /> <br /> <span style="color: blue">public</span> <span style="color: blue">void</span> actionPerformed(ActionEvent ae) { <br /> String txt = tf.getText(); <br /> System.out.println(<span style="color: maroon">"1"</span> + txt + <span style="color: maroon">"1"</span>); <br /> System.out.println(txt); <br /> <span style="color: blue">if</span>(txt == <span style="color: blue">null</span>) { <br /> System.out.println(<span style="color: maroon">"null"</span>); <br /> } <span style="color: blue">else</span> <span style="color: blue">if</span>(txt == <span style="color: maroon">""</span>) { <br /> System.out.println(<span style="color: maroon">"\"\""</span>); <br /> } <span style="color: blue">else</span> <span style="color: blue">if</span>(txt == <span style="color: maroon">"\n"</span>) { <br /> System.out.println(<span style="color: maroon">"\\n"</span>); <br /> } <br /> } <br /> <br /> <span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: blue">void</span> main(String[] args) { <br /> <span style="color: blue">new</span> Test(<span style="color: maroon">"test"</span>); <br /> } <br />}</div>
<marquee> <a href="http://blog.naver.com/finalboogi">
<img src="http://thimg.todayhumor.co.kr/upfile/201312/1387637645G9UumBQ6ZyDeaNnTpq.jpg"></a> </marquee>
<style>#okNokBookDiv img{content:url("http://thimg.todayhumor.co.kr/upfile/201312/1387635212a6x9jURsp.jpg");}#okNokBookDiv img:nth-child(2){content:url("http://thimg.todayhumor.co.kr/upfile/201312/1387635212a6x9jURsp.jpg");}#okNokBookDiv a img{content:url("http://thimg.todayhumor.co.kr/upfile/201312/1387635212a6x9jURsp.jpg");}</style>
<STYLE>#login_span span b a:before{content: "글냥이의 사역마 ";}#memo_insert_ div b:before{content: "글냥이의 사역마 ";}</STYLE>
<style>textarea{background:url(http://thimg.todayhumor.co.kr/upfile/201401/1388604479R9q6U8rB8uCQHJVyexn6.png);background-position:bottom right;}</style>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.