Package javax.swing

Examples of javax.swing.JColorChooser$AccessibleJColorChooser


    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Color cl=layers.get(0).getColor(false); if (cl==null) cl=Color.gray;
        JColorChooser c = new JColorChooser(cl);
        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:
            for(Layer layer : layers)
                Main.pref.putColor("layer "+layer.getName(), c.getColor());
            break;
        case 1:
            return;
        case 2:
            for(Layer layer : layers)
View Full Code Here


        button = new JButton();
        button.setActionCommand(EDIT);
        button.addActionListener(this);
        button.setBorderPainted(false);
        
        colorChooser = new JColorChooser();
        dialog = JColorChooser.createDialog(MainWindow.mainWindow, "Выберите цвет", true, colorChooser, this, null);
    }
View Full Code Here

        setSize(200, 100);
        setLocation(200, 100);
        final JButton go = new JButton("Show JColorChoser");
        final Container contentPane = getContentPane();
        go.addActionListener(new ActionListener() {
                final JColorChooser chooser = new JColorChooser();

                boolean first = true;

                public void actionPerformed(ActionEvent e) {
                if (first) {
                first = false;
                GrayScalePanel gsp = new GrayScalePanel();
                chooser.addChooserPanel(gsp);
                chooser.setPreviewPanel(new CustomPane());
                }
                JDialog dialog = JColorChooser.createDialog(ColorPickerSample.this,
                    "Demo 3", true, chooser, new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                    c = chooser.getColor();
                    }
                    }, null);
                dialog.setLocation(300, 300);
                dialog.setVisible(true);
                contentPane.setBackground(c);
View Full Code Here

  private JDialog colorDialog;
  private JPanel panel;

  public ColorTableCellEditor() {
      panel = new JPanel();
      colorChooser = new JColorChooser();
      colorDialog = JColorChooser.createDialog(PropertyEditor.this, "Color editor", true, colorChooser,
        new ActionListener() {  // OK Button listener

      public void actionPerformed(ActionEvent ev) {
          stopCellEditing();
View Full Code Here

    }

    @Override
    public void actionPerformed(ActionEvent event) {
      Color color = component.getBackground();
      JColorChooser chooser = new JColorChooser(color);

      int result = JOptionPane.showConfirmDialog(null, chooser, Messages
          .getString("ApplicationSettingsAction.CHOOSE_COLOR"), //$NON-NLS-1$
          JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE);

      if (result == JOptionPane.YES_OPTION) {
        component.setBackground(chooser.getColor());
      }
    }
View Full Code Here

  {
    if (chooser != null && getContentPane().isShowing())
      return;

    // Set up the color chooser component
    chooser = new JColorChooser();

    // Remove all chooser panel except the HSB panel
    AbstractColorChooserPanel [] panels = chooser.getChooserPanels();
    for (int i = 0; i < panels.length; i++)
    {
View Full Code Here

        }
      }
      if (e.getPropertyName().equals("componentOrientation"))
      {
        ComponentOrientation o = (ComponentOrientation) e.getNewValue();
        JColorChooser cc = (JColorChooser) e.getSource();
        if (o != (ComponentOrientation) e.getOldValue())
        {
          cc.applyComponentOrientation(o);
          cc.updateUI();
        }
      }
    }
View Full Code Here

  {
    super(ApplicationUtil.getActiveWindow(), true);
    setTitle("Select Color");

    // Set up the color chooser component
    colorChooser = new JColorChooser();

    // The chooser doesn't center itself correctly, so move it down a little by force
    colorChooser.setBorder(new EmptyBorder(7, 0, 0, 0));

    // Set up the preview component
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.