Skip to content

Instantly share code, notes, and snippets.

@alamenai
Created January 4, 2018 11:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alamenai/37a231be1b4f67fc0fa451682da0d611 to your computer and use it in GitHub Desktop.
Save alamenai/37a231be1b4f67fc0fa451682da0d611 to your computer and use it in GitHub Desktop.
simple code to show a dialog using JFXDialog of @jfoenix
private void showJDialog() {
JFXDialogLayout dialogContent = new JFXDialogLayout();
dialogContent.setHeading(new Text("Hello" == null ? "good" : "good" + "\n" + "Hello"));
dialogContent.setBody(new Text("Body"));
JFXButton close = new JFXButton("Close");
dialogContent.setActions(close);
JFXDialog dialog = new JFXDialog((StackPane) loginstage.getScene().getRoot(), dialogContent, JFXDialog.DialogTransition.CENTER);
close.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent __) {
dialog.close();
}
});
dialog.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment