mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
fix crash in server add dialog, #15
This commit is contained in:
parent
4ccb230141
commit
b5063ebc50
@ -16,7 +16,6 @@ package de.bixilon.minosoft.gui.main;
|
||||
import com.jfoenix.controls.JFXAlert;
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.controls.JFXDialogLayout;
|
||||
import com.jfoenix.controls.JFXTextField;
|
||||
import com.jfoenix.validation.RequiredFieldValidator;
|
||||
import de.bixilon.minosoft.Minosoft;
|
||||
import de.bixilon.minosoft.ShutdownReasons;
|
||||
@ -118,19 +117,13 @@ public class MainWindow implements Initializable {
|
||||
|
||||
JFXButton submitButton;
|
||||
|
||||
JFXTextField serverNameField = new JFXTextField();
|
||||
TextField serverNameField = new TextField();
|
||||
serverNameField.setPromptText(LocaleManager.translate(Strings.SERVER_NAME));
|
||||
|
||||
JFXTextField serverAddressField = new JFXTextField();
|
||||
TextField serverAddressField = new TextField();
|
||||
serverAddressField.setPromptText(LocaleManager.translate(Strings.SERVER_ADDRESS));
|
||||
RequiredFieldValidator serverAddressValidator = new RequiredFieldValidator();
|
||||
serverAddressValidator.setMessage(LocaleManager.translate(Strings.SERVER_ADDRESS_INPUT_REQUIRED));
|
||||
serverAddressField.getValidators().add(serverAddressValidator);
|
||||
serverAddressField.focusedProperty().addListener((observableValue, oldValue, newValue) -> {
|
||||
if (!newValue) {
|
||||
serverAddressField.validate();
|
||||
}
|
||||
});
|
||||
serverAddressField.setTextFormatter(new TextFormatter<String>((change) -> {
|
||||
change.setText(DNSUtil.correctHostName(change.getText()));
|
||||
return change;
|
||||
|
Loading…
x
Reference in New Issue
Block a user