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

📄 orderoperation.java

📁 航空航天订票系统 是数据库的课程设计 单机版
💻 JAVA
字号:
package GraphicsUI;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class OrderOperation extends QueryFlight implements ActionListener {
	JButton order;

	JPanel jp;

	public static boolean flag = false;

	public OrderOperation(MainFrame m) {
		super(m);
		order = new JButton("航班订票");
		jp = new JPanel();
		jp.setLayout(new FlowLayout());
		jp.add(order);
		order.addActionListener(this);
		super.two.add(jp);
	}

	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == order) {
			if (!flag) {
				flag = true;
				Object t1, t2;
				int t = super.jt.getSelectedRow();
				System.out.println("t=" + t);
				if (t == -1) {
					JOptionPane.showMessageDialog(null, "请选中一个航线", "错误",
							JOptionPane.ERROR_MESSAGE);
					flag = false;
				} else {
					t1 = super.jt.getValueAt(t, 0);
					// t2 = super.jt.getValueAt(t-1, 8);
					System.out.println("t1=" + t1);
					// System.out.println("t2=" + t2);
					new OrderButton(t1);
				}
			}
		}
		if (e.getSource() == super.select)
			super.actionPerformed(e);
		if (e.getSource() == super.clear)
			super.actionPerformed(e);
	}
}

⌨️ 快捷键说明

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