-
Notifications
You must be signed in to change notification settings - Fork 31
Home
4ntoine edited this page Dec 8, 2011
·
6 revisions
Welcome to the JavaFxDialog project!
There are no standard dialogs (Information, Warning, Error) in JavaFx 2, so i decided to implement them myself.
Enjoy!
- Information, Confirmation, Warning, Error and Throwable (with stacktrace panel) dialogs
- Short messages (with min width), long messages (with wrapping) and [multiline messages] (https://github.com/4ntoine/JavaFxDialog/blob/master/scr/multiline.png?raw=true) support
- Owner window support (no additional window button in task panel)
Class name.antonsmirnov.javafx.dialog.Dialog
:
public static void showInfo(String title, String message, Window owner)
public static void showWarning(String title, String message, Window owner)
public static void showError(String title, String message, Window owner)
public static void showThrowable(String title, String message, Throwable t, Window owner)
Note: there are according methods without 'owner' parameter.
Confirmation dialog usage (Builder pattern):
Dialog.buildConfirmation(title, message)
.addYesButton(yesButtonHandler)
.addNoButton(noButtonHandler)
.addCancelButton(cancelButtonHandler)
.build()
.show();
Note: make sure you've added one button at least or you'll get exception:
java.lang.RuntimeException: Add one dialog button at least
at name.antonsmirnov.javafx.dialog.Dialog$Builder.build(Dialog.java:363)
Anton Smirnov (dev [at] antonsmirnov [dot] name)
Free for noncommercial usage