154155156157158159160161162163164
// select the component's text textfield.selectAll(); // add a key listener textfield.addKeyListener(new PasswordListener()); // return the component return textfield; }