I have a JFace TitleAreaDialog with several Text widgets. A FocusListener on these Text widgets checks on FocusLost, if the input is valid e.g. a String value. If validation fails, an error message is printed. I would like to have the focus back in field that failed to validate. I tried: Text text = (Text) focusEvent.getSource(); text.setFocus();
This doesn't work, does anybody knows why? What else can I do, to remain in a Text widget, if a validation failed?