Backend complete. v0.3 ready for QA.

This commit is contained in:
Dmitry Isaenko 2019-03-20 00:56:44 +03:00
parent 65f084591a
commit 53a8a2337f
9 changed files with 132 additions and 74 deletions

View file

@ -114,7 +114,9 @@ public class SettingsController implements Initializable {
}));
pcPortTextField.setTextFormatter(new TextFormatter<Object>(change -> {
if (change.getControlNewText().matches("^[0-9]{0,5}$")) {
if ((Integer.parseInt(change.getControlNewText()) > 65535) || (Integer.parseInt(change.getControlNewText()) == 0)) {
if (!change.getControlNewText().isEmpty()
&& ((Integer.parseInt(change.getControlNewText()) > 65535) || (Integer.parseInt(change.getControlNewText()) == 0))
) {
ServiceWindow.getErrorNotification(resourceBundle.getString("windowTitleErrorPort"), resourceBundle.getString("windowBodyErrorPort"));
return null;
}