lab-04/NewAccount:
- method that returns defualt hbox of app. used in all others.
This commit is contained in:
parent
7f41f45acd
commit
58a6b7ecd8
@ -46,7 +46,7 @@ public class Main extends Application {
|
|||||||
HBox boxLasttName = makeLebelWithText("Last name: ");
|
HBox boxLasttName = makeLebelWithText("Last name: ");
|
||||||
HBox boxPassword = makeLebelWithText("Enter password");
|
HBox boxPassword = makeLebelWithText("Enter password");
|
||||||
HBox boxRePass = makeLebelWithText("Reenter password: ");
|
HBox boxRePass = makeLebelWithText("Reenter password: ");
|
||||||
HBox boxCity = makeLebelWithText("City");
|
HBox boxCity = makeLebelWithText("City: ");
|
||||||
HBox boxCountry = makeComboBoxWithLabel("Choose a country: ");
|
HBox boxCountry = makeComboBoxWithLabel("Choose a country: ");
|
||||||
HBox boxButtons = makeButtons();
|
HBox boxButtons = makeButtons();
|
||||||
|
|
||||||
@ -69,9 +69,7 @@ public class Main extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private HBox makeLebelWithText(String labelText){
|
private HBox makeLebelWithText(String labelText){
|
||||||
HBox node = new HBox();
|
HBox node = getStdHBox();
|
||||||
node.setPadding(new Insets(10));
|
|
||||||
node.setSpacing(10);
|
|
||||||
Label label = new Label(labelText);
|
Label label = new Label(labelText);
|
||||||
TextField textField = new TextField();
|
TextField textField = new TextField();
|
||||||
node.getChildren().addAll(label, textField);
|
node.getChildren().addAll(label, textField);
|
||||||
@ -79,19 +77,14 @@ public class Main extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private HBox makeComboBoxWithLabel(String labelText) {
|
private HBox makeComboBoxWithLabel(String labelText) {
|
||||||
HBox node = new HBox();
|
HBox node = getStdHBox();
|
||||||
node.setPadding(new Insets(10));
|
|
||||||
node.setSpacing(10);
|
|
||||||
Label label = new Label(labelText);
|
Label label = new Label(labelText);
|
||||||
node.getChildren().addAll(label, new ComboBox<>(FXCollections.observableArrayList(Countries)));
|
node.getChildren().addAll(label, new ComboBox<>(FXCollections.observableArrayList(Countries)));
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
private HBox makeButtons(){
|
private HBox makeButtons(){
|
||||||
HBox node = new HBox();
|
HBox node = getStdHBox();
|
||||||
node.setPadding(new Insets(10));
|
|
||||||
node.setSpacing(10);
|
|
||||||
node.setAlignment(Pos.CENTER);
|
|
||||||
Button bClear = new Button("Clear");
|
Button bClear = new Button("Clear");
|
||||||
Button bRegister = new Button("Register");
|
Button bRegister = new Button("Register");
|
||||||
bClear.setPrefSize(100, 20);
|
bClear.setPrefSize(100, 20);
|
||||||
@ -100,4 +93,12 @@ public class Main extends Application {
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private HBox getStdHBox() {
|
||||||
|
HBox node = new HBox();
|
||||||
|
node.setPadding(new Insets(10));
|
||||||
|
node.setSpacing(10);
|
||||||
|
node.setAlignment(Pos.CENTER);
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user