TextArea % TextFields
This commit is contained in:
parent
a083903272
commit
8e39471d60
@ -1,6 +1,9 @@
|
||||
package application;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Menu;
|
||||
import javafx.scene.control.MenuBar;
|
||||
import javafx.scene.control.MenuItem;
|
||||
@ -28,14 +31,30 @@ public class RootBorderPane extends BorderPane {
|
||||
public RootBorderPane() {
|
||||
initComponents();
|
||||
addComponents();
|
||||
addHandler();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
String promptText = "Bitte einen Text eingeben...";
|
||||
|
||||
menuBar = new MenuBar();
|
||||
mDatei = new Menu("Datei");
|
||||
mBearbeiten = new Menu("Bearbeiten");
|
||||
miBeenden = new MenuItem("Beenden");
|
||||
miReset = new MenuItem("Reset");
|
||||
|
||||
gpZentrum = new GridPane();
|
||||
gpZentrum.setAlignment(Pos.CENTER);
|
||||
|
||||
tfText1 = new TextField();
|
||||
tfText1.setPromptText(promptText);
|
||||
|
||||
tfText2 = new TextField();
|
||||
tfText2.setPromptText(promptText);
|
||||
|
||||
taErgebnis = new TextArea();
|
||||
taErgebnis.setDisable(true);
|
||||
taErgebnis.setEditable(false);
|
||||
}
|
||||
|
||||
private void addComponents() {
|
||||
@ -43,7 +62,23 @@ public class RootBorderPane extends BorderPane {
|
||||
mBearbeiten.getItems().addAll(miReset);
|
||||
menuBar.getMenus().addAll(mDatei, mBearbeiten);
|
||||
|
||||
gpZentrum.add(new Label("Verbinden"), 0, 0);
|
||||
gpZentrum.add(new Label("Text 1"), 0, 3);
|
||||
gpZentrum.add(new Label("Text 2"), 0, 4);
|
||||
gpZentrum.add(new Label("Ergebnis:"), 0, 5);
|
||||
|
||||
gpZentrum.add(tfText1, 1, 3);
|
||||
gpZentrum.add(tfText2, 1, 4);
|
||||
gpZentrum.add(taErgebnis, 1, 5);
|
||||
|
||||
// TODO Button
|
||||
|
||||
setTop(menuBar);
|
||||
setCenter(gpZentrum);
|
||||
}
|
||||
|
||||
private void addHandler() {
|
||||
miBeenden.setOnAction(event -> { Platform.exit(); } );
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user