Class ColorDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ColorDialog extends JDialog
See Also:
  • Field Details

    • colorPanel

      protected ColorPanel colorPanel
    • answer

      protected int answer
  • Constructor Details

    • ColorDialog

      public ColorDialog(String title, Color initColor, boolean allowNoColor)
      Constructor (transparency disabled).
      Parameters:
      title - probably a description of what is having its color changed
      initColor - the initial color
      allowNoColor - if true, user can select "no color"
    • ColorDialog

      public ColorDialog(String title, Color initColor, boolean allowNoColor, boolean allowTransparency)
      Constructor (transparency disabled).
      Parameters:
      title - probably a description of what is having its color changed
      initColor - the initial color
      allowNoColor - if true, user can select "no color"
      allowTransparency - if true, alpha color slider is enabled.
  • Method Details

    • setup

      protected void setup()
      Add the components to the dialog
    • getColor

      public Color getColor()
      Get the selected color
      Returns:
      the selected color
    • doClose

      protected void doClose(int reason)
      Close the dialog
      Parameters:
      reason - the reason it closed
    • getAnswer

      public int getAnswer()
      Get the reason the dialog closed
      Returns:
      the reason it closed