Documentation of 'jas2.util.JASDialog' Java class
JASDialog
jas2.util

Class JASDialog

  • All Implemented Interfaces:
    java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.DocumentListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    Direct Known Subclasses:
    CutAdjustmentDialog, DateChooser, ErrorBox, InstallPluginsUI, PluginDownloadProgress, PluginManagerUI, PropertyDialog, StatsWindow, UpdatePluginsUI


    public class JASDialog
    extends javax.swing.JDialog
    implements java.awt.event.MouseListener, javax.swing.event.DocumentListener
    JASDialog extends the built in java dialog to provide a number of extra features
    • Automatic placement relative to parent frame
    • OK, Cancel, Apply, and Help buttons at the bottom of the dialog box
    • Automatic disposal of the dialog when the user hits OK, Cancel or closes the dialog using the window manager
    To make components visible on this dialog, add them to the content pane.
    See Also:
    getContentPane(), Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.BaselineResizeBehavior
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int APPLY_BUTTON
      Include this in your flags to include an Apply button.
      static int CANCEL_BUTTON
      Include this in your flags to include a Cancel button.
      static int HELP_BUTTON
      Include this in your flags to include a Help button.
      static int OK_BUTTON
      Include this in your flags to include an OK button.
      • Fields inherited from class java.awt.Dialog

        DEFAULT_MODALITY_TYPE
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Constructor Summary

      Constructors 
      Constructor and Description
      JASDialog(java.awt.Dialog dlg, java.lang.String title)
      Creates a modal dialog with OK and Cancel buttons.
      JASDialog(java.awt.Dialog dlg, java.lang.String title, boolean modal)
      Creates a dialog with OK and Cancel buttons.
      JASDialog(java.awt.Dialog dlg, java.lang.String t, boolean modal, int flags)
      Creates a dialog box with any combination of buttons.
      JASDialog(java.awt.Frame frame, java.lang.String title)
      Creates a modal dialog with OK and Cancel buttons.
      JASDialog(java.awt.Frame frame, java.lang.String title, boolean modal)
      Creates a dialog with OK and Cancel buttons.
      JASDialog(java.awt.Frame f, java.lang.String t, boolean modal, int flags)
      Creates a dialog box with any combination of buttons.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void changedUpdate(javax.swing.event.DocumentEvent e)
      Calls callEnable() by default.
      static JASDialog create(java.awt.Component c, java.lang.String t, boolean modal, int flags) 
      static JASDialog create(java.awt.Frame frame, java.lang.String title) 
      static JASDialog create(java.awt.Frame frame, java.lang.String title, boolean modal) 
      void defaultPack()
      Causes default pack; does not move dialog.
      boolean doModal()
      Forces a modal display of the dialog box
      java.awt.Container getContentPane()
      Returns the content pane for the JASDialog, which is the panel (not including the buttons) where components can be added.
      void insertUpdate(javax.swing.event.DocumentEvent e)
      Calls callEnable() by default.
      void mouseClicked(java.awt.event.MouseEvent e)
      Does nothing by default.
      void mouseEntered(java.awt.event.MouseEvent e)
      Does nothing by default.
      void mouseExited(java.awt.event.MouseEvent e)
      Does nothing by default.
      void mousePressed(java.awt.event.MouseEvent e)
      Does nothing by default.
      void mouseReleased(java.awt.event.MouseEvent e)
      Does nothing by default.
      void pack()
      Causes a default pack(), but also places the dialog in the center of the parent frame.
      void processEvent(java.awt.AWTEvent e)
      This method is public as an implementation side effect; do not call or override.
      void removeUpdate(javax.swing.event.DocumentEvent e)
      Calls callEnable() by default.
      void setApplyLabel(java.lang.String label)
      Set the label on the Apply button.
      void setApplyMnemonic(char mnemonic)
      Sets the mnnemonic (or keyboard shortcut) for the Apply button.
      void setCancelLabel(java.lang.String label)
      Set the label on the Cancel button.
      void setCancelMnemonic(char mnemonic)
      Sets the mnnemonic (or keyboard shortcut) for the Cancel button.
      void setContentPane(java.awt.Container c)
      Sets the content pane.
      void setHelpTopic(java.lang.String topic)
      Sets the name for the help topic that the Help button opens.
      void setOKLabel(java.lang.String label)
      Set the label on the OK button.
      void setOKMnemonic(char mnemonic)
      Sets the mnnemonic (or keyboard shortcut) for the OK button.
      void show() 
      • Methods inherited from class javax.swing.JDialog

        getAccessibleContext, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
      • Methods inherited from class java.awt.Dialog

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, toBack
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • OK_BUTTON

        public static final int OK_BUTTON
        Include this in your flags to include an OK button.
        See Also:
        Constant Field Values
      • APPLY_BUTTON

        public static final int APPLY_BUTTON
        Include this in your flags to include an Apply button.
        See Also:
        Constant Field Values
      • CANCEL_BUTTON

        public static final int CANCEL_BUTTON
        Include this in your flags to include a Cancel button.
        See Also:
        Constant Field Values
      • HELP_BUTTON

        public static final int HELP_BUTTON
        Include this in your flags to include a Help button.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JASDialog

        public JASDialog(java.awt.Frame frame,
                         java.lang.String title)
        Creates a modal dialog with OK and Cancel buttons.
        Parameters:
        frame - the parent frame
        title - the title for the dialog box
      • JASDialog

        public JASDialog(java.awt.Frame frame,
                         java.lang.String title,
                         boolean modal)
        Creates a dialog with OK and Cancel buttons.
        Parameters:
        frame - the parent frame
        title - the title for the dialog box
        modal - whether the dialog box is modal
      • JASDialog

        public JASDialog(java.awt.Frame f,
                         java.lang.String t,
                         boolean modal,
                         int flags)
        Creates a dialog box with any combination of buttons. Use bitwise logic to specify the appropriate flags in the flags parameter. For example,
        JASDialog.OK_BUTTON | JASDialog.CANCEL_BUTTON | JASDialog.HELP_BUTTON
        when passed as the flags parameter will create a button that has an OK button, a Cancel button, and a Help button.
        Parameters:
        dlg - the parent Dialog
        title - the title for the dialog box
        modal - whether the dialog box is modal
        flags - option flags
      • JASDialog

        public JASDialog(java.awt.Dialog dlg,
                         java.lang.String title)
        Creates a modal dialog with OK and Cancel buttons.
        Parameters:
        frame - the parent frame
        title - the title for the dialog box
      • JASDialog

        public JASDialog(java.awt.Dialog dlg,
                         java.lang.String title,
                         boolean modal)
        Creates a dialog with OK and Cancel buttons.
        Parameters:
        dlg - the parent Dialog
        title - the title for the dialog box
        modal - whether the dialog box is modal
      • JASDialog

        public JASDialog(java.awt.Dialog dlg,
                         java.lang.String t,
                         boolean modal,
                         int flags)
        Creates a dialog box with any combination of buttons. Use bitwise logic to specify the appropriate flags in the flags parameter. For example,
        JASDialog.OK_BUTTON | JASDialog.CANCEL_BUTTON | JASDialog.HELP_BUTTON
        when passed as the flags parameter will create a button that has an OK button, a Cancel button, and a Help button.
        Parameters:
        dlg - the parent Dialog
        title - the title for the dialog box
        modal - whether the dialog box is modal
        flags - option flags
    • Method Detail

      • create

        public static JASDialog create(java.awt.Frame frame,
                                       java.lang.String title)
      • create

        public static JASDialog create(java.awt.Frame frame,
                                       java.lang.String title,
                                       boolean modal)
      • create

        public static JASDialog create(java.awt.Component c,
                                       java.lang.String t,
                                       boolean modal,
                                       int flags)
      • pack

        public void pack()
        Causes a default pack(), but also places the dialog in the center of the parent frame.
        Overrides:
        pack in class java.awt.Window
        See Also:
        Window.pack()
      • defaultPack

        public void defaultPack()
        Causes default pack; does not move dialog.
      • processEvent

        public void processEvent(java.awt.AWTEvent e)
        This method is public as an implementation side effect; do not call or override.
        Overrides:
        processEvent in class java.awt.Window
      • doModal

        public boolean doModal()
        Forces a modal display of the dialog box
        Returns:
        true if the OK button was pushed, otherwise false
      • show

        public void show()
        Overrides:
        show in class java.awt.Dialog
      • setOKLabel

        public void setOKLabel(java.lang.String label)
        Set the label on the OK button. Allows for customized button labels.
      • setOKMnemonic

        public void setOKMnemonic(char mnemonic)
        Sets the mnnemonic (or keyboard shortcut) for the OK button. If you have changed the label using setOKLabel(String) the default mnemonic ('O') may not be appropriate, so use this method to set a better one.
        Parameters:
        mnemonic - the new key shortcut to use
        See Also:
        setOKLabel(String)
      • setCancelLabel

        public void setCancelLabel(java.lang.String label)
        Set the label on the Cancel button. Allows for customized button labels.
      • setCancelMnemonic

        public void setCancelMnemonic(char mnemonic)
        Sets the mnnemonic (or keyboard shortcut) for the Cancel button. If you have changed the label using setCancelLabel(String) the default mnemonic ('C') may not be appropriate, so use this method to set a better one.
        Parameters:
        mnemonic - the new key shortcut to use
        See Also:
        setCancelLabel(String)
      • setApplyLabel

        public void setApplyLabel(java.lang.String label)
        Set the label on the Apply button. Allows for customized button labels.
      • setApplyMnemonic

        public void setApplyMnemonic(char mnemonic)
        Sets the mnnemonic (or keyboard shortcut) for the Apply button. If you have changed the label using setApplyLabel(String) the default mnemonic ('A') may not be appropriate, so use this method to set a better one.
        Parameters:
        mnemonic - the new key shortcut to use
        See Also:
        setApplyLabel(String)
      • getContentPane

        public java.awt.Container getContentPane()
        Returns the content pane for the JASDialog, which is the panel (not including the buttons) where components can be added. Add components to this container to have them appear in the dialog.
        Specified by:
        getContentPane in interface javax.swing.RootPaneContainer
        Overrides:
        getContentPane in class javax.swing.JDialog
      • setContentPane

        public void setContentPane(java.awt.Container c)
        Sets the content pane. The buttons are not members of this content pane.
        Specified by:
        setContentPane in interface javax.swing.RootPaneContainer
        Overrides:
        setContentPane in class javax.swing.JDialog
      • setHelpTopic

        public final void setHelpTopic(java.lang.String topic)
        Sets the name for the help topic that the Help button opens. Note: This is now being used to set the XML target for JavaHelp.
      • mouseClicked

        public void mouseClicked(java.awt.event.MouseEvent e)
        Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
      • mousePressed

        public void mousePressed(java.awt.event.MouseEvent e)
        Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
      • mouseReleased

        public void mouseReleased(java.awt.event.MouseEvent e)
        Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
      • mouseEntered

        public void mouseEntered(java.awt.event.MouseEvent e)
        Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
      • mouseExited

        public void mouseExited(java.awt.event.MouseEvent e)
        Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
      • insertUpdate

        public void insertUpdate(javax.swing.event.DocumentEvent e)
        Calls callEnable() by default. To use this class as a DocumentListener, override only the method(s) you need.
        Specified by:
        insertUpdate in interface javax.swing.event.DocumentListener
        See Also:
        callEnable()
      • removeUpdate

        public void removeUpdate(javax.swing.event.DocumentEvent e)
        Calls callEnable() by default. To use this class as a DocumentListener, override only the method(s) you need.
        Specified by:
        removeUpdate in interface javax.swing.event.DocumentListener
        See Also:
        callEnable()
      • changedUpdate

        public void changedUpdate(javax.swing.event.DocumentEvent e)
        Calls callEnable() by default. To use this class as a DocumentListener, override only the method(s) you need.
        Specified by:
        changedUpdate in interface javax.swing.event.DocumentListener
        See Also:
        callEnable()

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.