AppletContext: showDocument(URL url,String target)
import java.applet.AppletContext;
import java.awt.Graphics;
import java.net.URL;
import javax.swing.JApplet;
public class MainClass extends JApplet {
public void paint(Graphics g) {
AppletContext ac = getAppletContext();
try {
URL url = new URL("http://www.java2s.com");
ac.showDocument(url, "frame2");
} catch (Exception e) {
showStatus("Exception: " + e);
}
g.drawString("ShowDocument Applet", 10, 25);
}
}
Related examples in the same category