?? orderoperation.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 + -