List of usage examples for javax.swing JColorChooser addChooserPanel
public void addChooserPanel(AbstractColorChooserPanel panel)
From source file:Main.java
public static void main(String[] argv) { JColorChooser chooser = new JColorChooser(); chooser.addChooserPanel(new MyChooserPanel()); }
From source file:SystemColorChooserPanel.java
public static void main(String[] a) { JColorChooser colorChooser = new JColorChooser(); colorChooser.addChooserPanel(new SystemColorChooserPanel()); JDialog d = colorChooser.createDialog(null, "", true, colorChooser, null, null); d.setVisible(true);/*from w w w . ja va2s . co m*/ }
From source file:MainClass.java
public static void main(String[] a) { final JColorChooser colorChooser = new JColorChooser(); SystemColorChooserPanel newChooser = new SystemColorChooserPanel(); colorChooser.addChooserPanel(newChooser); ActionListener okActionListener = new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { System.out.println(colorChooser.getColor()); }/*from w ww . j av a 2 s. co m*/ }; ActionListener cancelActionListener = new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { System.out.println("Cancel"); } }; final JDialog dialog = JColorChooser.createDialog(null, "Change Button Background", true, colorChooser, okActionListener, cancelActionListener); dialog.setVisible(true); }