源程序
package cgi;import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
import java.io.*;
import javax.swing.*;public class Applet1 extends Applet {  private JButton jButton1 = new JButton();
  private JLabel jLabel1 = new JLabel();
  //Construct the applet
  public Applet1() {
  }
  //Initialize the applet
  public void init() {
    try {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
  //Component initialization
  private void jbInit() throws Exception
  {
    jButton1.setText("刷新");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(ActionEvent e) {
        jButton1_actionPerformed(e);
      }
    });
    
    try{
     URL url=new URL("http://192.168.4.36/icons/pic/1.gif");
     Toolkit tk=Toolkit.getDefaultToolkit();
     Image  image=tk.getImage(url);
     ImageIcon imgIcon = new ImageIcon(image);
     jLabel1.setIcon(imgIcon);
     }
     catch(Exception e1)
      {}
    this.add(jButton1, null);
    this.add(jLabel1, null);
   }
   //鼠标时间处理
   void jButton1_actionPerformed(ActionEvent e) {
      try{      URL url=new URL("http://192.168.4.36/icons/pic/1.gif");
      Toolkit tk=Toolkit.getDefaultToolkit();
      Image  image=tk.getImage(url);
      ImageIcon imgIcon = new ImageIcon(image);
      jLabel1.setIcon(imgIcon);
      }
      catch(Exception e1)
      {}  }}