求一个Java小程序

来源:百度知道 编辑:UC知道 时间:2024/05/02 16:34:01
能在JBUILDER中运行的,小游戏也行。年终JAVA课程要求交的。。请各位编程高手帮帮忙啊!!

网上一搜一大片 你不会那么懒吧?

import java.awt.*;
import java.io.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
public class SMS {
public static void main(String[] args) throws Exception{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame f = new JFrame("学生信息管理");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(688,380);
f.setResizable(false);
f.setLocationRelativeTo(null);
f.setContentPane(new SMSPanel());
f.setVisible(true);
}
}
//主面板
class SMSPanel extends JPanel implements ActionListener{
private static final long serialVersionUID = 6923196760525083410L;
private String filePath="c:/students.info.txt";//文件路径
private StudentModel sm = new StudentModel(filePath);

private JTextField name,id,classname,addr;
private JComboBox sex,department;
private JButton add,query