![](https://csdnimg.cn/release/download_crawler_static/86007641/bg1.jpg)
package pkg;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* 图形化界面
*/
public class ImageApp extends JApplet {
private static final long serialVersionUID = 1L;
static int i, j, k, r;
Container c;
JPanel p1, p2, p3;
JButton btReco, btCent, btFresh;
JLabel label1, label2, label3, label4;
JTextField write;
public void init() {
new ImageModel();
c = getContentPane();
p1 = new JPanel(new FlowLayout());
p2 = new JPanel(new FlowLayout(1, 0, 0));
p3 = new JPanel(new FlowLayout());
btReco = new JButton("识别");
btCent = new JButton("确定");
btFresh = new JButton("刷新");
btReco.setContentAreaFilled(false);
btCent.setContentAreaFilled(false);
btFresh.setContentAreaFilled(false);
i = random();
j = random();
k = random();
r = random();
ImageRecognitor.numString = null;
label1 = new JLabel(new ImageIcon("../img/00" + i + ".png"),
SwingConstants.CENTER); // 单张图片识别
new ImageRecognitor(i);