Good day. Can you please tell me how to do it for passwordfield , so that when you click on the login button, the message "No password entered" pops up?
Closed due to the fact that the essence of the question is unclear by the participants pavel , user194374, Denis , Kromster , Denis Bubnov on Dec 1 '16 at 8:18 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
|
1 answer
pass = new JPasswordField(10); pass.addKeyListener(new KeyListener(){ @Override public void keyTyped(KeyEvent e) { if(e.getKeyChar()==KeyEvent.VK_ENTER){ OKButton.doClick(); } } @Override public void keyPressed(KeyEvent e) { if(e.getKeyChar()==KeyEvent.VK_ENTER){ выскакивает сообщение "Не введен пароль" } } @Override public void keyReleased(KeyEvent e) { //Do Nothing } }); - one@ Victor can not be sent to Google, you can search the site. - Alex
|