public AdminFrame(DB database, String loginName) {
		super("Ա");
		this.database = database;
		this.loginName = loginName;

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

		// 3ť
		JButton button = new JButton("ӹԱ");
		layout.setConstraints(button, c);
		add(button);

		c.gridx = GridBagConstraints.RELATIVE;
		removeButton = new JButton("ɾԱ");
		removeButton.setEnabled(false); // бĳбѡвЧ
		layout.setConstraints(removeButton, c);
		add(removeButton);

		c.gridwidth = GridBagConstraints.REMAINDER;
		modifyButton = new JButton("޸");
		modifyButton.setEnabled(false); // бĳбѡвЧ
		layout.setConstraints(modifyButton, c);
		add(modifyButton);

		// ע3ť¼
		button.setActionCommand("add");
		removeButton.setActionCommand("remove");
		modifyButton.setActionCommand("modify");
		button.addActionListener(this);
		removeButton.addActionListener(this);
		modifyButton.addActionListener(this);

		// ɵ¼б
		listmodel = new DefaultListModel<String>();
		list = new JList<String>(listmodel);
		this.updateList();
		list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		list.getSelectionModel().addListSelectionListener(
				new ListSelectionListener() {
					@Override
					public void valueChanged(ListSelectionEvent e) {
						if (list.getSelectedIndex() < 0) {
							removeButton.setEnabled(false);
							modifyButton.setEnabled(false);
						} else {
							removeButton.setEnabled(true);
							modifyButton.setEnabled(true);
						}
					}
				});

		JScrollPane listPane = new JScrollPane(list);
		c.fill = GridBagConstraints.BOTH;
		c.weightx = 1.0;
		c.weighty = 1.0;
		c.gridy = GridBagConstraints.RELATIVE;
		c.gridheight = GridBagConstraints.REMAINDER;
		layout.setConstraints(listPane, c);
		add(listPane);

		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		pack();
	}