public MainFrame(DB database, String loginName) {
		super("ѧϢϵͳ");

		this.database = database;
		this.dialog = new StudentDialog(this);
		this.admin = new AdminFrame(database, loginName);
		this.author = new Author();

		// òֹ
		GridBagLayout layout = new GridBagLayout();
		GridBagConstraints c = new GridBagConstraints();
		this.setLayout(layout);

		// Ӳ˵
		addMenu();

		// 
		this.showAll = true;
		JPanel filter = this.buildFilterPanel();
		c.gridwidth = GridBagConstraints.REMAINDER;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.anchor = GridBagConstraints.NORTH;
		c.weightx = 1.0;
		layout.setConstraints(filter, c);
		add(filter);

		// 
		JPanel sort = this.buildSortPanel();
		c.gridy = GridBagConstraints.RELATIVE;
		layout.setConstraints(sort, c);
		add(sort);

		// ѧ,
		this.students = database.getAllStudent();
		sort(students);
		this.tableModel = new StudentTableModel(students);
		table = new JTable(this.tableModel);

		// ӱҼ˵
		menu = this.buildTableMenu();
		table.addMouseListener(new MouseAdapter() {

			@Override
			public void mousePressed(MouseEvent e) {
				if (e.isPopupTrigger()) {
					menu.show(e.getComponent(), e.getX(), e.getY());
				}
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				if (e.isPopupTrigger()) {
					menu.show(e.getComponent(), e.getX(), e.getY());
				}
			}

		});

		// deleteɾһѧ
		// һֻѡһ
		table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		table.addKeyListener(new KeyAdapter() {

			@Override
			public void keyPressed(KeyEvent e) {
				if (e.getKeyCode() == KeyEvent.VK_DELETE)
					remove();
			}

		});

		// øеĿ
		TableColumnModel colModel = table.getColumnModel();
		colModel.getColumn(0).setPreferredWidth(70);
		colModel.getColumn(1).setPreferredWidth(50);
		colModel.getColumn(2).setPreferredWidth(30);
		colModel.getColumn(3).setPreferredWidth(30);
		colModel.getColumn(4).setPreferredWidth(70);
		colModel.getColumn(5).setPreferredWidth(200);
		colModel.getColumn(6).setPreferredWidth(100);
		colModel.getColumn(7).setPreferredWidth(150);

		// ñ
		JScrollPane tablePane = new JScrollPane(table);
		tablePane.setPreferredSize(new Dimension(700, 500));
		c.fill = GridBagConstraints.BOTH;
		c.weighty = 1.0;
		c.gridheight = GridBagConstraints.REMAINDER;
		layout.setConstraints(tablePane, c);
		add(tablePane);

		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		pack();
		setCenter();
		Point loc = this.getLocation();
		dialog.setLocation(loc);
		admin.setLocation(loc);
		author.setLocation(loc);
	}