final JMenuItem newItemMenuItem_1 = new newItemMenuItem_1.addActionListener(new
public void actionPerformed(final }
kechengxinxi c=new kechengxinxi(); dispose();
JMenuItem(); ActionListener() { ActionEvent e) {
c.setVisible(true);
});
newItemMenuItem_1.setText(\课程信息管理\); menu.add(newItemMenuItem_1);
public void
chengjixinxi c=new
final JMenuItem newItemMenuItem_2 =
new JMenuItem();
newItemMenuItem_2.addActionListener(new ActionListener() {
actionPerformed(final ActionEvent e) { chengjixinxi();
c.setVisible(true); }
dispose();
});
newItemMenuItem_2.setText(\成绩信息menu.add(newItemMenuItem_2);
public void
xueqixinxi c=new
final JMenuItem
管理\);
newItemMenuItem_3 = new JMenuItem();
newItemMenuItem_3.addActionListener(new ActionListener() {
actionPerformed(final ActionEvent e) { xueqixinxi();
c.setVisible(true); }
dispose();
});
newItemMenuItem_3.setText(\
学期信息管理\);
final JMenuItem
menu.add(newItemMenuItem_3);
newItemMenuItem_6 = new JMenuItem();
newItemMenuItem_6.addActionListener(new ActionListener() {
actionPerformed(final ActionEvent e) {
System.exit(0);
newItemMenuItem_6.setText(\退出\); menu.add(newItemMenuItem_6);
JMenu();
menu_2.setText(\);
public void
}
});
JMenu menu_2 = new menuBar.add(menu_2);
public static void main(String args[]) {
/**
* Create the frame */
public xueshengxinxi() {
super();
setTitle(\); getContentPane().setLayout(null); setBounds(100, 100, 500, 375);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
String su,sp; su=\; }
EventQueue.invokeLater(new Runnable() {
public void run() { }
try { }
xueshengxinxi frame = new xueshengxinxi(); frame.setVisible(true); e.printStackTrace();
} catch (Exception e) {
});
sp=\;
try {
Class.forName( \ ); cn=
DriverManager.getConnection( \eName=学生成绩管理系统\ , su, sp);
} catch (ClassNotFoundException e1) { }
final JButton button = new JButton();
button.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
t1 = new JTextField();
t1.setBounds(95, 28, 87, 22); getContentPane().add(t1);
final JLabel label = new JLabel(); label.setText(\学号\);
label.setBounds(23, 30, 66, 18); getContentPane().add(label);
e1.printStackTrace();
e.printStackTrace(); } catch (SQLException e) {
String sql=\学生信息 where 学号='\+t1.getText()+\;
try {
sa=cn.createStatement(); re=sa.executeQuery(sql); if(re.next()) {
ta.setText(\学号:\+re.getString(1)+\姓名:
\+re.getString(2)+\班级:\+re.getString(3)+\地址:\+re.getString(4)+\电话:\+re.getString(5));
}
}
}
else {
JOptionPane.showMessageDialog(null, \失败\); }
e1.printStackTrace();
} catch (SQLException e1) {
});
button.setText(\查询\);
button.setBounds(188, 25, 66, 28); getContentPane().add(button);
final JButton button_1 = new JButton();
button_1.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
String sql=\学生信息 where 学号='\+t1.getText()+\;
}
try { }
sa=cn.createStatement(); s=sa.executeUpdate(sql); if(s==1) { } else {
JOptionPane.showMessageDialog(null, \失败\); }
e1.printStackTrace();
JOptionPane.showMessageDialog(null, \删除成功\);
} catch (SQLException e1) {
});
button_1.setText(\删除\);
button_1.setBounds(260, 25, 66, 28);