import java.applet.*; import java.awt.*; import java.awt.event.*; import java.net.*; public class show_c extends Applet implements ActionListener { public void actionPerformed( ActionEvent aev ) { this.handle_show_btn(); } // actionPerformed public void handle_show_btn() { String yahoo_page = "http://www.yahoo.com"; URL yahoo_url = null; try { yahoo_url = new URL( yahoo_page ); } // try catch ( MalformedURLException exc ) { } // catch if ( yahoo_url != null ) { super.getAppletContext().showDocument( yahoo_url ); } // if } // handle_show_btn public void init() { super.init(); super.setLayout( null ); Button show_btn = new Button( "Ladda YAHOO-sida" ); super.add( show_btn ); show_btn.setBounds( 20, 50, 160, 30 ); show_btn.addActionListener( this ); } // init } // show_c