import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;
public class ImageApplet extends JApplet {
private JPanel jContentPane = null;
private JPanel jPanel = null;
ImageIcon imageIcon = new ImageIcon("images/icon/common/det_dis.gif");
/**
* This is the default constructor
*/
public ImageApplet() {
super();
}
/**
* This method initializes this
*
* @return void
*/
public void init() {
this.setSize(640, 480);
this.setContentPane(getJContentPane());
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(new MainPanel(imageIcon), null);
}
return jContentPane;
}
/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
*/
class MainPanel extends JPanel implements MouseListener,
MouseMotionListener {
int x1, y1;
//用来表示向东、南、西、北、东、南、东、北、西南、西北八个方向缩放点
private JLabel northWest = null;
private JLabel north = null;
private JLabel northEast = null;
private JLabel east = null;
private JLabel southEast = null;
private JLabel south = null;
private JLabel southWest = null;
private JLabel west = null;