Package javax.swing

Examples of javax.swing.JColorChooser$AccessibleJColorChooser


    JMenuItem color = new JMenuItem(tr("Customize Color"),
        ImageProvider.get("colorchooser"));
    color.putClientProperty("help", "Action/LayerCustomizeColor");
    color.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        JColorChooser c = new JColorChooser(getColor(name));
        Object[] options = new Object[] { tr("OK"), tr("Cancel"),
            tr("Default") };
        int answer = JOptionPane.showOptionDialog(Main.parent, c,
            tr("Choose a color"), JOptionPane.OK_CANCEL_OPTION,
            JOptionPane.PLAIN_MESSAGE, null, options, options[0]);
        switch (answer) {
        case 0:
          Main.pref.putColor("layer " + name, c.getColor());
          break;
        case 1:
          return;
        case 2:
          Main.pref.putColor("layer " + name, null);
View Full Code Here


            @Override
            public void exceptionalAction() throws Exception {
                panel.getColorSelectionModel();
            }
        });
        JColorChooser chooser = new JColorChooser();
        int oldListenersCount = ((DefaultColorSelectionModel) chooser.getSelectionModel())
                .getChangeListeners().length;
        panel.installChooserPanel(chooser);
        assertSame(chooser.getColor(), panel.getColorFromModel());
        assertEquals(oldListenersCount + 1, ((DefaultColorSelectionModel) chooser
                .getSelectionModel()).getChangeListeners().length);
        panel.uninstallChooserPanel(chooser);
        assertEquals(oldListenersCount, ((DefaultColorSelectionModel) chooser
                .getSelectionModel()).getChangeListeners().length);
    }
View Full Code Here

public class ColorChooserComponentFactoryTest extends BasicSwingTestCase {
    private JColorChooser colorChooser;

    @Override
    public void setUp() throws Exception {
        colorChooser = new JColorChooser(Color.GREEN);
    }
View Full Code Here

    private BasicColorChooserUI ui;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        ch = new JColorChooser();
        ui = (BasicColorChooserUI) ch.getUI();
    }
View Full Code Here

    public static Color showDialog1(Component component, String title,
        Color initialColor) throws HeadlessException {

      AbstractColorChooserPanel[] oldPanels;
      JColorChooser pane = new JColorChooser(
          initialColor != null ? initialColor : Color.white);

      oldPanels = pane.getChooserPanels();
      for (int i = 0; i < oldPanels.length; i++) {
        String clsName = oldPanels[i].getClass().getName();
        if (clsName
            .equals("javax.swing.colorchooser.DefaultRGBChooserPanel")) {
          // Remove rgb chooser if desired
          pane.removeChooserPanel(oldPanels[i]);
        } else if (clsName
            .equals("javax.swing.colorchooser.DefaultHSBChooserPanel")) {
          // Remove hsb chooser if desired
          pane.removeChooserPanel(oldPanels[i]);
        }
      }
      pane.setPreviewPanel(new JPanel());
      ColorTracker ok = new ColorTracker(pane);
      JDialog dialog = createDialog(component, title, true, pane, ok,
          null);

      dialog.setVisible(true);
View Full Code Here

   * @param value
   *          the value
   */
  public ColorChooserComponent(Color value) {
    setLayout(new BorderLayout());
    chooser = new JColorChooser(value);
    add(chooser, BorderLayout.CENTER);
  }
View Full Code Here

        }
        else if(htmlTag.toString().equals(HTML.Tag.FONT.toString()))
        {
          if(htmlAttribs.containsKey("color"))
          {
            Color color = new JColorChooser().showDialog(parentEkit.getFrame(), Translatrix.getTranslationString("CustomColorDialog"), Color.black);
              if(color != null)
            {
              StyledEditorKit.ForegroundAction customColorAction = new StyledEditorKit.ForegroundAction("CustomColor", color);
              customColorAction.actionPerformed(ae);
            }
View Full Code Here

   * @return the ARGB colour as a 32 bit integer (as used in Processing).
   */
  public static int selectColor(){
    Frame owner = (sketchApplet == null) ? null : sketchApplet.frame;
    if(chooser == null){
      chooser = new JColorChooser();
      AbstractColorChooserPanel[] oldPanels = chooser.getChooserPanels();
      // Do not assume what panels are present
      LinkedList<AbstractColorChooserPanel> panels = new LinkedList<AbstractColorChooserPanel>()
      for(AbstractColorChooserPanel p : oldPanels){
        String displayName = p.getDisplayName().toLowerCase();
View Full Code Here

import javax.swing.JApplet;
import javax.swing.JColorChooser;

public class Test4380468 extends JApplet {
    public void init() {
        add(new JColorChooser(Color.GREEN));
    }
View Full Code Here

import javax.swing.JColorChooser;
import javax.swing.JPanel;

public class Test4759306 extends JApplet {
    public void init() {
        JColorChooser chooser = new JColorChooser();
        chooser.setPreviewPanel(new JPanel());
        getContentPane().add(chooser);
    }
View Full Code Here

TOP

Related Classes of javax.swing.JColorChooser$AccessibleJColorChooser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.