[ java ] in KIDS 글 쓴 이(By): uhihi (너의이뿌니) 날 짜 (Date): 1998년 10월 27일 화요일 오후 08시 01분 51초 제 목(Title): NullPointerException 어케할까요 도와주� import java.awt.*; import java.awt.event.*; import java.net.*; import java.net.MalformedURLException; public class HandleButton extends java.applet.Applet implements ActionListener { Regmember App; TextField name, id, pw, cf, add; HandleButton(Regmember a, TextField n,TextField i, TextField p,TextField pc, TextField ad){ App = a; name = n; id = i; pw = p; cf = pc; add = ad; } public void actionPerformed (ActionEvent e){ if (e.getSource() instanceof Button) { String un = "http://namhae.duksung.ac.kr/~h03056/public_html/index.htm"; String pwnot = "http://namhae.duksung.ac.kr/~h03056/public_html/frame.htm"; String good = "http://namhae.duksung.ac.kr/~h03056/public_html/i_sora.htm"; URL theURL = null; try { if ((name.getText().equals(""))||(id.getText().equals(""))||(pw.getText().equals(" "))||(add.getText().equals(""))){ theURL =new URL(un); getAppletContext().showDocument(theURL); } else {if (!(pw.getText().equals(cf.getText()))){ theURL =new URL(pwnot); getAppletContext().showDocument(theURL); } else { theURL =new URL(good); getAppletContext().showDocument(theURL); } } } catch(MalformedURLException c){ System.out.println("Bad URL : " + theURL); } } } } |