|
@@ -45,6 +45,8 @@ public class EditUsernameDialogController implements Initializable {
|
45
|
45
|
private ButtonPressEvent cancelListener;
|
46
|
46
|
private UserList userList;
|
47
|
47
|
|
|
48
|
+ private final int MAX_LENGTH = 16;
|
|
49
|
+
|
48
|
50
|
@FXML
|
49
|
51
|
private void onConfirm() {
|
50
|
52
|
setLocked(true);
|
|
@@ -101,6 +103,10 @@ public class EditUsernameDialogController implements Initializable {
|
101
|
103
|
public void onUsernameChange(ObservableValue<? extends String> observable, String oldText, String newText) {
|
102
|
104
|
setFieldError(State.VALID);
|
103
|
105
|
confirmButton.setDisable(newText.isEmpty());
|
|
106
|
+ if (textField.getText().length() > MAX_LENGTH) {
|
|
107
|
+ String s = textField.getText().substring(0, MAX_LENGTH);
|
|
108
|
+ textField.setText(s);
|
|
109
|
+ }
|
104
|
110
|
}
|
105
|
111
|
|
106
|
112
|
public void setMode(Mode mode) {
|