Class JFontChooser

    • Constructor Detail

      • JFontChooser

        public JFontChooser​(JFrame owner,
                            String title,
                            Font initialFont)
        Constructor
        Parameters:
        owner - parent frame or null
        title - dialog title
        initialFont - the initial font for the chooser to display, or null for the GeoTools default font
      • JFontChooser

        public JFontChooser​(JDialog owner,
                            String title,
                            Font initialFont)
        Constructor
        Parameters:
        owner - parent dialog or null
        title - dialog title
        initialFont - the initial font for the chooser to display, or null for the GeoTools default font
    • Method Detail

      • showDialog

        public static Font showDialog​(Component owner,
                                      String title,
                                      Font labelFont)
        Static method to display a JFontChooser dialog and return the selected font as a new Font object.
        Parameters:
        owner - the parent JFrame or JDialog; may be null
        title - dialog title
        labelFont - the initial font displayed by the dialog, or null for the default GeoTools font
        Returns:
        a new Font object or null if the user cancelled the dialog
      • completed

        public boolean completed()
        Query if the dialog was completed (user clicked the Apply button)
        Returns:
        true if completed; false otherwise
      • getSelectedFont

        public Font getSelectedFont()
        Get the selected font
        Returns:
        the selected font or null if the dialog was cancelled