Class MessageBox


  • public final class MessageBox
    extends java.lang.Object
    Displays message box with specified options.
    Since:
    1.3.0, 1.5.0 changed to wrapper class removing Platform.runLater() requirement.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DialogResult show​(java.lang.String text)
      Displays message box with specified text.
      static DialogResult show​(java.lang.String text, java.lang.String title)
      Displays message box with specified text and title.
      static DialogResult show​(java.lang.String text, java.lang.String title, MessageBoxButtons buttons)
      Displays message box with specified text, title and buttons.
      static DialogResult show​(java.lang.String text, java.lang.String title, MessageBoxButtons buttons, MessageBoxDefaultButton defaultButton)
      Displays message box with specified text, title, buttons and default button.
      static DialogResult show​(java.lang.String text, java.lang.String title, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
      Displays message box with specified text, title, buttons, icon and default button.
      static DialogResult show​(java.lang.String text, java.lang.String title, MessageBoxIcon icon)
      Displays message box with specified text, title and icon.
      static DialogResult show​(java.lang.String text, java.lang.String title, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
      Displays message box with specified text, title, icon and default button.
      static DialogResult show​(java.lang.String text, java.lang.String title, java.lang.String headerText)
      Displays message box with specified text, title and header text.
      static DialogResult show​(java.lang.String text, java.lang.String title, java.lang.String headerText, MessageBoxButtons buttons)
      Displays message box with specified text, title, header text and buttons.
      static DialogResult show​(java.lang.String text, java.lang.String title, java.lang.String headerText, MessageBoxButtons buttons, MessageBoxDefaultButton defaultButton)
      Displays message box with specified text, title, header text, buttons and default button.
      static DialogResult show​(java.lang.String text, java.lang.String title, java.lang.String headerText, MessageBoxButtons buttons, MessageBoxIcon icon)
      Displays message box with specified text, title, header text, buttons and icon.
      static DialogResult show​(java.lang.String text, java.lang.String title, java.lang.String headerText, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
      Displays message box with specified text, title, header text, buttons, icon and default button.
      static DialogResult show​(java.lang.String text, java.lang.String title, java.lang.String headerText, MessageBoxIcon icon)
      Displays message box with specified text, title, header text and icon.
      static DialogResult show​(java.lang.String text, java.lang.String title, java.lang.String headerText, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
      Displays message box with specified text, title, header text, icon and default button.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        java.lang.String headerText,
                                        MessageBoxButtons buttons,
                                        MessageBoxIcon icon,
                                        MessageBoxDefaultButton defaultButton)
        Displays message box with specified text, title, header text, buttons, icon and default button.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        headerText - The text to display in the header section of the message box
        buttons - One of the MessageBoxButtons values that specifies which buttons to display in the message box
        icon - One of the MessageBoxIcons values that specifies which icon to display in the message box
        defaultButton - One of the MessageBoxDefaultButton values that specifies the default button for the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        java.lang.String headerText,
                                        MessageBoxButtons buttons,
                                        MessageBoxIcon icon)
        Displays message box with specified text, title, header text, buttons and icon.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        headerText - The text to display in the header section of the message box
        buttons - One of the MessageBoxButtons values that specifies which buttons to display in the message box
        icon - One of the MessageBoxIcons values that specifies which icon to display in the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        java.lang.String headerText,
                                        MessageBoxButtons buttons,
                                        MessageBoxDefaultButton defaultButton)
        Displays message box with specified text, title, header text, buttons and default button.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        headerText - The text to display in the header section of the message box
        buttons - One of the MessageBoxButtons values that specifies which buttons to display in the message box
        defaultButton - One of the MessageBoxDefaultButton values that specifies the default button for the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        java.lang.String headerText,
                                        MessageBoxIcon icon,
                                        MessageBoxDefaultButton defaultButton)
        Displays message box with specified text, title, header text, icon and default button.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        headerText - The text to display in the header section of the message box
        icon - One of the MessageBoxIcons values that specifies which icon to display in the message box
        defaultButton - One of the MessageBoxDefaultButton values that specifies the default button for the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        MessageBoxButtons buttons,
                                        MessageBoxIcon icon,
                                        MessageBoxDefaultButton defaultButton)
        Displays message box with specified text, title, buttons, icon and default button.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        buttons - One of the MessageBoxButtons values that specifies which buttons to display in the message box
        icon - One of the MessageBoxIcons values that specifies which icon to display in the message box
        defaultButton - One of the MessageBoxDefaultButton values that specifies the default button for the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        MessageBoxButtons buttons,
                                        MessageBoxDefaultButton defaultButton)
        Displays message box with specified text, title, buttons and default button.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        buttons - One of the MessageBoxButtons values that specifies which buttons to display in the message box
        defaultButton - One of the MessageBoxDefaultButton values that specifies the default button for the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        MessageBoxIcon icon,
                                        MessageBoxDefaultButton defaultButton)
        Displays message box with specified text, title, icon and default button.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        icon - One of the MessageBoxIcons values that specifies which icon to display in the message box
        defaultButton - One of the MessageBoxDefaultButton values that specifies the default button for the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        java.lang.String headerText,
                                        MessageBoxButtons buttons)
        Displays message box with specified text, title, header text and buttons.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        headerText - The text to display in the header section of the message box
        buttons - One of the MessageBoxButtons values that specifies which buttons to display in the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        java.lang.String headerText,
                                        MessageBoxIcon icon)
        Displays message box with specified text, title, header text and icon.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        headerText - The text to display in the header section of the message box
        icon - One of the MessageBoxIcons values that specifies which icon to display in the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        MessageBoxButtons buttons)
        Displays message box with specified text, title and buttons.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        buttons - One of the MessageBoxButtons values that specifies which buttons to display in the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        MessageBoxIcon icon)
        Displays message box with specified text, title and icon.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        icon - One of the MessageBoxIcons values that specifies which icon to display in the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title,
                                        java.lang.String headerText)
        Displays message box with specified text, title and header text.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        headerText - The text to display in the header section of the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text,
                                        java.lang.String title)
        Displays message box with specified text and title.
        Parameters:
        text - The text to display in the message box
        title - The text to display in the title bar of the message box
        Returns:
        DialogResult representing the return value of the message box
      • show

        public static DialogResult show​(java.lang.String text)
        Displays message box with specified text.
        Parameters:
        text - The text to display in the message box
        Returns:
        DialogResult representing the return value of the message box