show.setText("你将了:");
show.append("学号为 " + s1 + " 的学生 数学成绩更改为:" + math + " 英语成绩更改为:"
+ english);
show.append("\n");
} catch (SQLException e) {
System.out.println(e);
}
}
}
6.4 查找模块
首先由用户输入要查找的学生学号等,然后查找数据库中的该学生信息
主要代码:class chaxun extends JFrame implements ActionListener {
JFrame frame = new JFrame("查询记录");
JPanel imagePanel;
ImageIcon bg;
Button xunzhao;
TextField input;
TextArea show;
Box box;
String s;
Connection con;
Statement sql;
ResultSet rs;
chaxun() {
Toolkit kit = Toolkit.getDefaultToolkit();
Image img = kit.getImage("tubiao.jpg");
frame.setIconImage(img);
xunzhao = new Button("查找");
input = new TextField(10);
show = new TextArea(6, 43);
xunzhao.addActionListener(this);
show.setEditable(false);
box = Box.createHorizontalBox();
Label l1=new Label("输入学号");
13