ava.awt.FlowLayout;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.TableCellRenderer;
class CM extends JFrame implements ActionListener {// 课程信息管理
JPanel p = new JPanel();
JButton btnAdd = new JButton("增加");
JButton btnDelete = new JButton("删除");
JButton btnAlter = new JButton("修改");
JButton btnSearch = new JButton("查询");
JButton btnDisplay = new JButton("显示");
JMenuBar mb = new JMenuBar();
JPanel p1 = new JPanel();;
JTable sTable;
JScrollPane scroll;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
Object[][] playerInfo;
CSelect cst;
String mkch = null;
boolean bstd = false;
CM(String title) {// 构造方法
super(title);
add("South", p);
this.add("Center", p1);
mb.add(btnAdd);
mb.add(btnDelete);
mb.add(btnAlter);
mb.add(btnSearch);
mb.add(btnDisplay);
this.connDB();// 连接数据库
this.setBounds(200, 200, 400, 260);
btnAdd.addActionListener(this);
btnDelete.addActionListener(this);
btnAlter.addActionListener(this);
btnSearch.addActionListener(this);
btnDisplay.addActionListener(this);
this.setJMenuBar(mb);
// this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
show();
}
CM(CSelect cst, String title) {// 构造方法
super(title);
this.cst = cst;
bstd = true;
add("South", p);
this.add("Center", p1);
mb.add(btnAdd);
mb.add(btnDelete);
mb.add(btnAlter);
mb.add(btnSearch);
mb.add(btnDisplay);
this.connDB();
this.setBounds(200, 200, 400, 260);
btnAdd.addActionListener(this);
btnDelete.addActionListener(this);
btnAlter.addActionListener(this);
btnSearch.addActionListener(this);
btnDisplay.addActionListener(this);
this.setJMenuBar(mb);
// this.setDefaultCloseOperation(JFrame.EXIT_O