public loginDialog(MainFrame frame) {
        super(frame,true);
        setTitle("½");

        JPanel contentPanel=new JPanel(new FlowLayout());   //
        this.setContentPane(contentPanel);

        contentPanel.add(new JLabel("û:"));
        final JTextField nameText=new JTextField(10);
        contentPanel.add(nameText);

        contentPanel.add(new JLabel(":"));
        final JPasswordField passText=new JPasswordField(10);
        contentPanel.add(passText);

        JButton okBtn=new JButton("ȷ");
        okBtn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {        //ť
                String name;        //ûû
                String pass;        //û
                int result;         //½У
                name=nameText.getText();    //ûû
                pass=String.valueOf(passText.getPassword());    //û
                result= LoginBLL.check(name,pass);      //Уû
                if(result==1)           //ȷ
                {
                    JOptionPane.showMessageDialog(null,"½ɹ"); //ɹʾ
                    loginDialog.this.dispose();     //رնԻ
                }
                else        //ʾ
                {
                    JOptionPane.showMessageDialog(null,"");
                }

            }
        });

        JButton cancelBtn=new JButton("ȡ");        //ȡť
        cancelBtn.addActionListener(new ActionListener() {  //ûȡ¼˳
            @Override
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });
        contentPanel.add(okBtn);
        contentPanel.add(cancelBtn);

        addWindowListener(new WindowAdapter() {     //ûرնԻ˳
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });

        setSize(200,150);       //öԻ
        setResizable(false);
        setLocationRelativeTo(null);
        setVisible(true);
    }