⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 huoche.java

📁 车辆管理系统
💻 JAVA
字号:
package carmanage;

import java.awt.*;

import javax.swing.*;
import java.awt.Rectangle;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2008</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class HuoChe extends JFrame {
    public HuoChe() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        getContentPane().setLayout(null);
        jButton1.setBounds(new Rectangle(463, 425, 110, 45));
        jButton1.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
        jButton1.setText("返回");
        jButton1.addActionListener(new HuoChe_jButton1_actionAdapter(this));
        jLabel1.setBounds(new Rectangle(14, 15, 597, 421));
        jLabel1.addAncestorListener(new HuoChe_jLabel1_ancestorAdapter(this));
        this.getContentPane().add(jLabel1);
        this.getContentPane().add(jButton1);
        this.setSize(650,500);
        this.setVisible(true);
        setTitle("显示货车照片");

    }

    JButton jButton1 = new JButton();
    JLabel jLabel1 = new JLabel();
    public void jButton1_actionPerformed(ActionEvent e) {
     this.dispose();
    }

    public void jLabel1_ancestorAdded(AncestorEvent event) {
        jLabel1.setIcon(new ImageIcon("huoche.jpg"));
    }
}


class HuoChe_jLabel1_ancestorAdapter implements AncestorListener {
    private HuoChe adaptee;
    HuoChe_jLabel1_ancestorAdapter(HuoChe adaptee) {
        this.adaptee = adaptee;
    }

    public void ancestorAdded(AncestorEvent e) {
        adaptee.jLabel1_ancestorAdded(e);
    }

    public void ancestorRemoved(AncestorEvent ancestorEvent) {
    }

    public void ancestorMoved(AncestorEvent ancestorEvent) {
    }
}


class HuoChe_jButton1_actionAdapter implements ActionListener {
    private HuoChe adaptee;
    HuoChe_jButton1_actionAdapter(HuoChe adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton1_actionPerformed(e);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -