如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
packagehomework;importjava.awt.BorderLayout;importjava.awt.FlowLayout;importjava.awt.GridLayout;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.io.BufferedReader;importjava.io.BufferedWriter;importjava.io.File;importjava.io.FileNotFoundException;importjava.io.FileReader;importjava.io.FileWriter;importjava.io.IOException;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JOptionPane;importjavax.swing.JPanel;importjavax.swing.JTextField;publicclassStudentFrmextendsJFrameimplementsActionListener{Gradegrade=newGrade("HT1211");intindex=0;JLabellblName=newJLabel("学生姓名:");JLabellblAge=newJLabel("学生年龄:");JTextFieldtxtName=newJTextField();JTextFieldtxtAge=newJTextField();JButtonbtnAdd=newJButton("添加");JButtonbtnFind=newJButton("查找");JButtonbtnSave=newJButton("保存");JButtonbtnFirst=newJButton("|<");JButtonbtnPrev=newJButton("<<");JButtonbtnNext=newJButton(">>");JButtonbtnLast=newJButton(">|");JPanelp1=newJPanel();JPanelp2=newJPanel();JPanelp3=newJPanel();JPanelp4=newJPanel();StudentFrm(){p1.setLayout(newGridLayout(2,2));p1.add(lblName);p1.add(txtName);p1.add(lblAge);p1.add(txtAge);p2.setLayout(newFlowLayout());p2.add(btnAdd);p2.add(btnFind);p2.add(btnSave);p3.setLayout(newFlowLayout());p3.add(btnFirst);p3.add(btnPrev);p3.add(btnNext);p3.add(btnLast);p4.setLayout(newGridLayout(2,1));p4.add(p2);p4.add(p3);btnAdd.addActionListener(this);btnFind.addActionListener(this);btnSave.addActionListener(this);btnFirst.addActionListener(this);btnNext.addActionListener(this);btnPrev.addActionListener(this);btnLast.addActionListener(this);read();this.getContentPane().setLayout(newBorderLayout());this.getContentPane().add(p1,BorderLayout.CENTER);this.getContentPane().add(p4,BorderLayout.SOUTH);this.setSize(300,200);this.setTitle("学生管理");this.setVisible(