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

📄 taxi.java~6~

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

import java.awt.*;

import javax.swing.*;
import java.awt.Rectangle;
import java.awt.Font;
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 Taxi extends JFrame {
    public Taxi() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        getContentPane().setLayout(null);
        jLabel1.setBounds(new Rectangle(15, 24, 603, 485));
        jLabel1.addAncestorListener(new Taxi_jLabel1_ancestorAdapter(this));
        jButton1.setBounds(new Rectangle(343, 516, 117, 43));
        jButton1.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
        jButton1.setText("返回");
        this.getContentPane().add(jLabel1);
        this.getContentPane().add(jButton1);
        this.setSize(600,600);
        this.setVisible(true);
        setTitle("显示出租车照片");

    }

    JLabel jLabel1 = new JLabel();
    JButton jButton1 = new JButton();
    public void jLabel1_ancestorAdded(AncestorEvent event) {
        jLabel1.setIcon(new ImageIcon("taxi.jpg"));
    }
}


class Taxi_jLabel1_ancestorAdapter implements AncestorListener {
    private Taxi adaptee;
    Taxi_jLabel1_ancestorAdapter(Taxi adaptee) {
        this.adaptee = adaptee;
    }

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

    public void ancestorRemoved(AncestorEvent ancestorEvent) {
    }

    public void ancestorMoved(AncestorEvent ancestorEvent) {
    }
}

⌨️ 快捷键说明

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