JColorChooser: setDragEnabled(boolean b) : JColorChooser « javax.swing « Java by API






JColorChooser: setDragEnabled(boolean b)


import java.awt.BorderLayout;

import javax.swing.JColorChooser;
import javax.swing.JFrame;

public class MainClass {

  public static void main(final String args[]) {
    JFrame frame = new JFrame("Double Color Choosers");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JColorChooser left = new JColorChooser();
    left.setDragEnabled(true);
    frame.add(left, BorderLayout.WEST);

    JColorChooser right = new JColorChooser();
    right.setDragEnabled(true);
    frame.add(right, BorderLayout.EAST);

    frame.pack();
    frame.setVisible(true);

  }
}

           
       








Related examples in the same category

1.JColorChooser: addChooserPanel(AbstractColorChooserPanel p)
2.JColorChooser: createDialog(Component c, String t, boolean m, JColorChooser c, ActionListener ok, ActionListener cancel)
3.JColorChooser: getSelectionModel()
4.JColorChooser: setPreviewPanel(JComponent preview)
5.JColorChooser: showDialog(Component component, String title, Color initialColor)