JApplet: showStatus(String text) : JApplet « javax.swing « Java by API






JApplet: showStatus(String text)

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

1.JApplet: destroy()
2.JApplet: init()
3.JApplet: paint(Graphics g)
4.JApplet: setJMenuBar(JMenuBar menuBar)
5.JApplet: start()
6.JApplet: stop()