📄 returnoperation.java
字号:
package GraphicsUI;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ReturnOperation extends QueryFlight implements ActionListener {
JButton retur;
JPanel jp;
public static boolean flag = false;
public ReturnOperation(MainFrame m) {
super(m);
retur = new JButton("航班退票");
jp = new JPanel();
jp.setLayout(new FlowLayout());
jp.add(retur);
retur.addActionListener(this);
super.two.add(jp);
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == retur) {
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 ReturnButton(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 + -