Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8097923

[Ensemble8] Need various improvements in Dialog sample

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 8u40
    • 8u40
    • javafx
    • None

      I have a few suggestions for the new Dialog sample. I consider the first two to be the important ones, especially since I don't think it is a "best practice" of using Alerts as it stands.

      1) The examples should use modal, blocking dialogs by default, since this is the more common use case especially for a confirmation Alert and TextInput dialog (which are pretty useless without being blocking). I recommend to remove the call to show() from the various create methods and instead have the caller (the onAction lambdas) call showAndWait and do something with the Result).

      An option to do a non-modal (but still blocking) dialog might make sense, but is not necessary for 8u40.

      Also, and option to do a non-blocking dialog (show rather than showAndWait) could make sense for dialogs that don't produce an answer (Informational, Warning, Error), but this may not be worth the effort for 8u40.


      2) You need to remove the unused com.sun.javafx.* import since samples should not import anything from impl packages.


      Minor suggestions:

      3) I think a ChoiceBox or ComboBox might be a better selector than a SplitMenu for choosing the AlertType (ask Jonathan, though)

            ekleyman Elina Kleyman (Inactive)
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: