home *** CD-ROM | disk | FTP | other *** search
/ Java by Example / jbecd.bin / JBE-CD / JavaByExample / chap30 / lst30_2.txt < prev    next >
Encoding:
Text File  |  1996-03-19  |  412 b   |  22 lines

  1. public boolean action(Event evt, Object arg)
  2. {
  3.     try
  4.         GetURL();
  5.     catch (MalformedURLException e)
  6.     {
  7.         badURL = true;
  8.         repaint();
  9.     }
  10.     
  11.     return true;
  12. }
  13.  
  14. protected void GetURL() throws MalformedURLException
  15. {
  16.     String str = textField.getText();
  17.     URL url = new URL(str);
  18.     AppletContext context = getAppletContext();
  19.     context.showDocument(url);
  20. }
  21.  
  22.