Class AbstractSimpleDialog

    • Constructor Detail

      • AbstractSimpleDialog

        public AbstractSimpleDialog​(String title)
        Creates a new modal, non-resizable dialog with a null parent.
        Parameters:
        title - dialog title
      • AbstractSimpleDialog

        public AbstractSimpleDialog​(JFrame parent,
                                    String title)
        Creates a new modal, non-resizable dialog.
        Parameters:
        parent - parent frame
        title - dialog title
      • AbstractSimpleDialog

        public AbstractSimpleDialog​(JDialog parent,
                                    String title)
        Creates a new modal, non-resizable dialog.
        Parameters:
        parent - parent dialog
        title - dialog title
      • AbstractSimpleDialog

        public AbstractSimpleDialog​(JFrame parent,
                                    String title,
                                    boolean modal,
                                    boolean resizable)
        Creates a new modal, non-resizable dialog.
        Parameters:
        parent - parent frame
        title - dialog title
        modal - whether to make the dialog application modal
        resizable - whether to make the dialog resizable
      • AbstractSimpleDialog

        public AbstractSimpleDialog​(JDialog parent,
                                    String title,
                                    boolean modal,
                                    boolean resizable)
        Creates a new modal, non-resizable dialog.
        Parameters:
        parent - parent dialog
        title - dialog title
        modal - whether to make the dialog application modal
        resizable - whether to make the dialog resizable
    • Method Detail

      • setVisible

        public void setVisible​(boolean b)
        Overrides:
        setVisible in class Dialog
      • initComponents

        protected void initComponents()
        Creates the main control panel and components. This must be called by the sub-class. We do this to give sub-classes the chance to initialize fields which can be used within createControlPanel() (called as part of this method).
      • createControlPanel

        public abstract JPanel createControlPanel()
        Implemented by the sub-class to provide a panel with controls.
        Returns:
        panel with controls
      • onOK

        public abstract void onOK()
        Implemented by the sub-class to respond to the OK button.
      • onCancel

        public void onCancel()
        Called when the cancel button is pressed. The base implementation simply closes (disposes) the dialog.
      • closeDialog

        public void closeDialog()
        Close the dialog using a call to Window.dispose().
      • createButtonPanel

        protected JPanel createButtonPanel()
        Creates the OK and Cancel buttons on a panel.
        Returns:
        the button panel