【发布时间】:2014-04-09 14:32:08
【问题描述】:
if(e.getSource() == credLimit){ // event handling for user to change credit limit
String input = JOptionPane.showInputDialog(null, "Enter Password");
input.setEchoChar('*'); <<-----here is what I have tried
if(input.equals(password)) { // password check for credit limit
double credLimitTotal = Double.parseDouble(changeCredLimit.getText());
JOptionPane.showMessageDialog(null, currentCreditCard.changeCreditLimit(credLimitTotal));
changeCredLimit.setText("");
}
}
所以,我希望隐藏输入对话框中的文本,setEchoChar 不起作用
【问题讨论】:
标签: java user-interface input dialog