@Override
    public void focusGained(FocusEvent e) {
        if(e.getSource() == frame.name && frame.name.getText().equals("Логин")) frame.name.setText("");
        else if(e.getSource() == frame.password && new String(frame.password.getPassword()).equals("Пароль")) frame.password.setText("");
        else if(e.getSource() == frame.answer && frame.answer.getText().equals("Ваш ответ..")) frame.answer.setText("");
    }