Guest User

Untitled

a guest
May 26th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. final JButton btnPotvrda = new JButton(MainFrame.getInstance().getResourceBundle().getString("btnPotvrda"));
  2. btnPotvrda.addActionListener(new ActionListener() {
  3.  
  4. @Override
  5. public void actionPerformed(ActionEvent e) {
  6.  
  7.  
  8. if(tfUser.getText().trim().length()==0 ||
  9. tfPass.getText().trim().length()==0){
  10. if(tfUser.getText().trim().length()==0)
  11. tfUser.setBackground(Color.RED);
  12. if(tfUser.getText().trim().length()==0)
  13. tfPass.setBackground(Color.RED);
  14.  
  15. JOptionPane.showMessageDialog(null,MainFrame.getInstance().getResourceBundle().getString("Warning"));
  16. tfUser.setBackground(Color.WHITE);
  17. tfPass.setBackground(Color.WHITE);
  18.  
  19.  
  20.  
  21.  
  22.  
  23. }
  24. }
  25. });
Add Comment
Please, Sign In to add comment