I know that there are other questions about it, but I can't find the error in my code even with these. I wrote this to check if what is written in my textField is a path but it seems to be uncorrect. Here the code:
textFieldNewGameUrl.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
boolean isMatched = (textFieldNewGameUrl.getText()).matches("([a-zA-Z]:)?(\\\\[a-zA-Z0-9_.-]+)+\\\\?");
if(isMatched){
labelNewGameFeedback.setText("Ok, the path is correct");
}
else{
labelNewGameFeedback.setText("Strange things have happened : check the path.");
}
}
});