import
javafx.application.Application;
import
javafx.scene.Scene;
import
javafx.scene.control.Button;
import
javafx.scene.layout.*;
import
javafx.event.ActionEvent;
import
javafx.event.EventHandler;
import
javafx.scene.control.*;
import
javafx.stage.Stage;
import
javafx.scene.control.Alert.AlertType;
import
java.time.LocalDate;
public
class
TextInputDialog_2
extends
Application {
public
void
start(Stage s)
{
s.setTitle(
"creating textInput dialog"
);
TilePane r =
new
TilePane();
Label l =
new
Label(
"no text input"
);
TextInputDialog td =
new
TextInputDialog();
Button d =
new
Button(
"click"
);
EventHandler<ActionEvent> event =
new
EventHandler<ActionEvent>() {
public
void
handle(ActionEvent e)
{
td.showAndWait();
l.setText(td.getEditor().getText());
}
};
d.setOnAction(event);
r.getChildren().add(d);
r.getChildren().add(l);
Scene sc =
new
Scene(r,
500
,
300
);
s.setScene(sc);
s.show();
}
public
static
void
main(String args[])
{
launch(args);
}
}