我可以禁用JLabel鼠标事件吗?

时间:2016-03-28 12:29:50

标签: java swing

我想禁用report_unlock。有人可以解释一下吗?

private void report_unlockMouseClicked(java.awt.event.MouseEvent evt) {                                           

        String password=JOptionPane.showInputDialog("Enter the security key:");

        if(password.contains("xxxxxxx")){
            reports.setEnabled(true);
            JOptionPane.showMessageDialog(null, "Login success ", "Report Unlock",JOptionPane.PLAIN_MESSAGE);
            report_unlock.setEnabled(false);
        }
        else{
            reports.setEnabled(false);
            JOptionPane.showMessageDialog(null, "Login unsuccess ", "Report Unlock",JOptionPane.PLAIN_MESSAGE);
        }

0 个答案:

没有答案