Package javax.swing

Examples of javax.swing.JComboBox$AccessibleJComboBox$AccessibleJComboBoxPropertyChangeListener


    contentPane.add(entryLabelCarrier, BorderLayout.WEST);


    this.options = Arrays.asList(entry.getOptions());

    content = new JComboBox(entry.getOptions());
    content.addItemListener(new ComboBoxSelectionHandler());
    contentPane.add(content, BorderLayout.CENTER);
    setContentPane(contentPane);
    reset();
  }
View Full Code Here


    protected JComboBox combo;

    public ComboBoxPropertyEditor() {}

    public void setOptions(String[] options) {
        combo = new JComboBox(options);
        setCustomEditor(combo);
    }
View Full Code Here

        c.fill = GridBagConstraints.HORIZONTAL;
        panel.setLayout(gridbag);

        JPanel unitPanel = PaletteHelper.createPaletteJPanel(getUnitAdjustmentTitle());
        Object[] units = new Object[] { Length.METER, Length.FEET };
        JComboBox unitBox = new JComboBox(units);
        unitBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                JComboBox unitBox = (JComboBox) ae.getSource();
                setDisplayUnits((Length) unitBox.getSelectedItem());
            }
        });
        unitPanel.add(unitBox);
        gridbag.setConstraints(unitPanel, c);
        panel.add(unitPanel);
View Full Code Here

                    "No Layers available for creation.");
            JLabel label = new JLabel(message);
            gridbag.setConstraints(label, c);
            add(label);
        } else {
            list = new JComboBox(layerTypes);
           
            gridbag.setConstraints(list, c);
            add(list);
            c.insets = new Insets(5, 10, 10, 10);
            c.gridwidth = GridBagConstraints.RELATIVE;
View Full Code Here

    final int maxMonth = this.dateView.getMaximum(Calendar.MONTH);
    final String[] months = new String[maxMonth - minMonth + 1];
    System.arraycopy(SerialDate.getMonths(), minMonth, months, 0,
        months.length);

    this.monthSelector = new JComboBox(months);
    this.monthSelector.addActionListener(new MonthSelectionAction());
    p.add(this.monthSelector);

    this.yearSelector = new JComboBox(getYears(0));
    this.yearSelector.addActionListener(new YearSelectionAction());
    p.add(this.yearSelector);

    return p;
  }
View Full Code Here

    /**
     * Invoked when an action occurs.
     */
    public void actionPerformed(final ActionEvent e)
    {
      final JComboBox c = (JComboBox) e.getSource();

      // In most cases, changing the month will not change the selected
      // day.  But if the selected day is 29, 30 or 31 and the newly
      // selected month doesn't have that many days, we revert to the
      // last day of the newly selected month...
      final int dayOfMonth = dateView.get(Calendar.DAY_OF_MONTH);
      dateView.set(Calendar.DAY_OF_MONTH, 1);
      dateView.set(Calendar.MONTH, c.getSelectedIndex());
      final int maxDayOfMonth = dateView.getActualMaximum(Calendar.DAY_OF_MONTH);
      dateView.set(Calendar.DAY_OF_MONTH, Math.min(dayOfMonth, maxDayOfMonth));
      selectedDate = dateView.getTime();
      refreshButtons();
    }
View Full Code Here

     */
    public void actionPerformed(final ActionEvent e)
    {
      if (!refreshing)
      {
        final JComboBox c = (JComboBox) e.getSource();
        final Integer y = (Integer) c.getSelectedItem();

        // in most cases, changing the year will not change the
        // selected day.  But if the selected day is Feb 29, and the
        // newly selected year is not a leap year, we revert to
        // Feb 28...
View Full Code Here

        }
        unitStrings[unitStrings.length - 1] = i18n.get(this,
                "unitStrings.concentric",
                "concentric");

        JComboBox combo = new JComboBox(unitStrings);
        combo.setBorder(new EmptyBorder(0, 1, 0, 1));
        combo.setSelectedIndex(currentIndex);
        combo.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JComboBox jcb = (JComboBox) e.getSource();
                OMRangeRings rr = (OMRangeRings) circle;
                Length newLength = Length.get((String) jcb.getSelectedItem());
                Length oldLength = rr.getIntervalUnits();

                /*
                 * If newLength is not null and oldLength is not null, just
                 * translate the distance that is current specified. If
View Full Code Here

            // The ETOPO resolution selector
            JPanel resPanel = PaletteHelper.createPaletteJPanel("Lat/Lon Spacing");
            String[] resStrings = { "2 Minute", "5 Minute", "10 Minute",
                    "15 Minute" }; // ep-g

            JComboBox resList = new JComboBox(resStrings);
            resList.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JComboBox jcb = (JComboBox) e.getSource();
                    int newRes = jcb.getSelectedIndex();
                    int curRes = minuteSpacing / 5; // ep-g
                    if (curRes != newRes)
                        spacingReset = true;
                    switch (newRes) {
                    case 0:
                        minuteSpacing = 2;
                        break; // ep-g
                    case 1:
                        minuteSpacing = 5;
                        break; // ep-g
                    case 2:
                        minuteSpacing = 10;
                        break; // ep-g
                    case 3:
                        minuteSpacing = 15;
                        break; // ep-g
                    }

                }
            });

            resList.setSelectedIndex(minuteSpacing / 5); // ep-g
            resPanel.add(resList);

            // The ETOPO view selector
            JPanel viewPanel = PaletteHelper.createPaletteJPanel("View Type");
            String[] viewStrings = { "Grayscale Shading", "Color Shading" };

            JComboBox viewList = new JComboBox(viewStrings);
            viewList.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JComboBox jcb = (JComboBox) e.getSource();
                    int newView = jcb.getSelectedIndex();
                    if (newView != viewType)
                        slopeReset = true;
                    switch (newView) {
                    case 0:
                        viewType = SLOPESHADING;
View Full Code Here

        palette.add(new JLabel("\u00b0 "));
        attributeBox.add(palette);

        String[] sizesStrings = { "3", "5", "8", "10", "12", "14", "18", "20",
                "24", "36", "48" };
        sizesFont = new JComboBox(sizesStrings);
        sizesFont.setToolTipText(i18n.get(EditableOMText.class,
                "sizesFont",
                I18n.TOOLTIP,
                "Font Size"));
        sizesFont.setSelectedItem("" + (text.getFont()).getSize());
View Full Code Here

TOP

Related Classes of javax.swing.JComboBox$AccessibleJComboBox$AccessibleJComboBoxPropertyChangeListener

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.