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("");
}
}
打字所以,我希望隱藏從使用inputdialog文本時隱藏文本,setEchoChar
不起作用如何使用inputdialog
這是HTML,而不是Java –