public pwdDialog(MainFrame mainFrame) {
        super(mainFrame,true);
        setTitle("뱸");       //ñ

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

        JScrollPane tablePanel=new JScrollPane();       //ñ
        contentPanel.add(tablePanel,BorderLayout.CENTER);   //tablepanelм
        table=pwdBLL.getJTable();                   //pwdBLLȡJTable
        final DefaultTableModel tableModel= (DefaultTableModel) table.getModel();   //ñmodel

        tablePanel.setViewportView(table);          //tablepanel

        JPanel controlPanel=new JPanel(new BorderLayout());     //ÿưť
        contentPanel.add(controlPanel,BorderLayout.SOUTH);

        JPanel textPanel=new JPanel();                  //ʾı
        controlPanel.add(textPanel,BorderLayout.NORTH);

        textPanel.add(new JLabel(": "));
        IDLabel=new JLabel("");           //IDǩ
        textPanel.add(IDLabel);


        textPanel.add(new JLabel(": "));      //ı
        nameText=new JTextField(10);
        textPanel.add(nameText);

        textPanel.add(new JLabel(": "));
        pwdText=new JTextField(10);
        textPanel.add(pwdText);

        textPanel.add(new JLabel("ע: "));
        commentsText=new JTextField(10);
        textPanel.add(commentsText);

        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);  //ѡģʽΪѡ
        table.addMouseListener(new MouseAdapter(){    //¼
            public void mouseClicked(MouseEvent e){
                int selectedRow = table.getSelectedRow(); //ѡ
                Object o1 = tableModel.getValueAt(selectedRow, 0);      //ѡеĵ0Ԫ
                Object o2 = tableModel.getValueAt(selectedRow, 1);
                Object o3 = tableModel.getValueAt(selectedRow, 2);
                Object o4 = tableModel.getValueAt(selectedRow, 3);
                IDLabel.setText(o1.toString());  //ıֵ
                nameText.setText(o2.toString());
                pwdText.setText(o3.toString());
                commentsText.setText(o4.toString());
            }
        });

        JPanel buttonPanel=new JPanel();            //Ӱť
        controlPanel.add(buttonPanel,BorderLayout.SOUTH);

        final JButton addButton = new JButton("");   //Ӱť
        addButton.addActionListener(new ActionListener(){//¼
            public void actionPerformed(ActionEvent e){   //Ӽ

               int resultID=-1;     //resultIDΪݵID
               resultID=pwdBLL.add(nameText.getText(),pwdText.getText(),commentsText.getText());    //ݿݲID
               String []rowValues = {String.valueOf(resultID),nameText.getText(),pwdText.getText(),commentsText.getText()};
               tableModel.addRow(rowValues);  //һ
               int rowCount = table.getRowCount() +1;   //1
                JOptionPane.showMessageDialog(null,"ӳɹ");
            }
        });
        buttonPanel.add(addButton);



        final JButton updateButton = new JButton("޸");   //޸İť
        updateButton.addActionListener(new ActionListener(){//¼
            public void actionPerformed(ActionEvent e){
                int selectedRow = table.getSelectedRow();//ѡе
                if(selectedRow!= -1)   //Ƿѡ
                {
                    //޸ֵָ

                    tableModel.setValueAt(nameText.getText(), selectedRow, 1);
                    tableModel.setValueAt(pwdText.getText(), selectedRow, 2);
                    tableModel.setValueAt(commentsText.getText(), selectedRow, 3);
                }

                pwdBLL.update(IDLabel.getText(),nameText.getText(),pwdText.getText(),commentsText.getText());   //ݿ
                JOptionPane.showMessageDialog(null,"޸ĳɹ");
            }
        });
        buttonPanel.add(updateButton);


        final JButton delButton = new JButton("ɾ");        //ɾť
        delButton.addActionListener(new ActionListener(){//¼
            public void actionPerformed(ActionEvent e){
                String ID;
                int selectedRow = table.getSelectedRow();//ѡе
                ID=(String)tableModel.getValueAt(selectedRow, 0);
                if(selectedRow!=-1)  //ѡ
                {
                    tableModel.removeRow(selectedRow);  //ɾ
                }
                pwdBLL.delete(ID);
                JOptionPane.showMessageDialog(null,"ɾɹ");
            }
        });
        buttonPanel.add(delButton);

        final JButton searchButton = new JButton("");     //ť
        searchButton.addActionListener(new ActionListener(){//¼
            public void actionPerformed(ActionEvent e){
                int selectedItem;
                String searchText;
                new searchDialog(pwdDialog.this,items);     //Ի
                selectedItem=searchDialog.getSelectedItem();        //
                searchText=searchDialog.getSearchText();            //
                highlightRow(selectedItem,searchText);              //ѯ
            }

            private void highlightRow(final int selectedItem, final String searchText) {    //ָ

                final DefaultTableCellRenderer tcr = new DefaultTableCellRenderer()
                {

                    public Component getTableCellRendererComponent(JTable table, Object value,
                                                                   boolean isSelected, boolean hasFocus, int row, int column)
                    {
                        if(tableModel.getValueAt(row, selectedItem).toString().equals(searchText)){
                            setBackground(Color.yellow);        //ƥбΪɫ
                        }
                        else
                            setBackground(Color.white);         //Ϊɫ
                        return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
                    }
                };
                for(int i=0;i<items.length;i++)
                {
                    table.getColumn(items[i]).setCellRenderer(tcr);
                }
                tableModel.fireTableDataChanged();

            }
        });
        buttonPanel.add(searchButton);
        searchButton.setToolTipText("Ͻ޸");



        setSize(800, 400);          //öԻ
        this.setLocationRelativeTo(null);
        setVisible(true);
    }