Class JColorSelector

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
JAlphaColorSelector, JSmartColorSelector

public class JColorSelector extends JPanel
Component that allows color selection by clicking on it. Fires an ActionEvent if a new color has been chosen.
See Also:
  • Field Details

    • title

      protected String title
    • color

      protected Color color
    • textComponent

      protected JTextField textComponent
  • Constructor Details

    • JColorSelector

      public JColorSelector()
    • JColorSelector

      public JColorSelector(String title)
    • JColorSelector

      public JColorSelector(JTextField comp)
    • JColorSelector

      public JColorSelector(String title, JTextField comp)
  • Method Details

    • textComponentChanged

      protected void textComponentChanged()
    • setTitle

      public void setTitle(String title)
      Since:
      7.0
    • getTitle

      public String getTitle()
      Since:
      7.0
    • getTextComponent

      public JTextField getTextComponent()
      Since:
      8.3.4
    • setTextComponent

      public void setTextComponent(JTextField textComponent)
      Synchronize text component with this color selector
      Since:
      8.3.4
    • getHTMLColor

      public String getHTMLColor()
    • toString

      public String toString()
      Overrides:
      toString in class Component
    • getColor

      public Color getColor()
    • setColor

      public void setColor(String htmlColor)
    • setColor

      public void setColor(Color color)
      Sets the color. Since jAlbum 8.2.4, fires a PropertyChangeEvent instead of an ActionEvent
      Parameters:
      color -
    • showDialog

      public static Color showDialog(Component component, String title, Color initialColor, boolean colorTransparencySelectionEnabled) throws HeadlessException
      Copied from Java API and adjusted to present HSV panel first
      Throws:
      HeadlessException
    • removeActionListener

      public void removeActionListener(ActionListener l)
    • addActionListener

      public void addActionListener(ActionListener l)
    • fireActionOccured

      protected void fireActionOccured(ActionEvent e)
    • paintComponent

      protected void paintComponent(Graphics g2d)
      Overrides:
      paintComponent in class JComponent