Package javax.swing

Examples of javax.swing.JComboBox.addActionListener()


      tempHolder.add(new JLabel("Class: "), BorderLayout.WEST);
      tempHolder.add(classCombo, BorderLayout.EAST);
      comboHolder.add(tempHolder, BorderLayout.WEST);
      add(comboHolder, BorderLayout.NORTH);
           
      classCombo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          int selected = classCombo.getSelectedIndex();
          if (selected >= 0) {
            for (int i = 0; i < m_plots.size(); i++) {
              m_plots.get(i).setColoringIndex(selected);
View Full Code Here


  }

  protected JComboBox createZoomSelector(final PreviewPane pane)
  {
    final JComboBox zoomSelect = new JComboBox(pane.getZoomModel());
    zoomSelect.addActionListener(new ZoomSelectAction(pane.getZoomModel(), pane));
    zoomSelect.setAlignmentX(Component.RIGHT_ALIGNMENT);
    return zoomSelect;
  }

View Full Code Here

      final JComboBox dashComboBox = new JComboBox(new Object[]{BorderStyle.SOLID, BorderStyle.DASHED,
          BorderStyle.DOTTED, BorderStyle.DOT_DASH, BorderStyle.DOT_DOT_DASH});
      dashComboBox.setRenderer(new BorderStyleRenderer());
      dashComboBox.setSelectedItem(borderStyle);
      dashComboBox.addActionListener(new DashSelectionHandler(dashComboBox));
      this.add(dashComboBox, constraints);

      // Add the sample box
      constraints.gridx = 0;
      constraints.gridy = 2;
View Full Code Here

        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());
            }
        });
View Full Code Here

                "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();
View Full Code Here

            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)
View Full Code Here

            // 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;
View Full Code Here

        renderTypes[OMGraphic.RENDERTYPE_LATLON - 1] = rtc[0];
        renderTypes[OMGraphic.RENDERTYPE_XY - 1] = rtc[1];
        renderTypes[OMGraphic.RENDERTYPE_OFFSET - 1] = rtc[2];

        JComboBox renderTypeList = new JComboBox(renderTypes);
        renderTypeList.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JComboBox jcb = (JComboBox) e.getSource();
                String currentChoice = (String) jcb.getSelectedItem();
                if (currentChoice == rtc[2]) {
                    defaultGraphicAttributes.setRenderType(OMGraphic.RENDERTYPE_OFFSET);
View Full Code Here

                Debug.output("Adding TOOL " + toolNames[i] + " to menu");
            }
        }

        JComboBox tools = new JComboBox(toolNames);
        tools.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JComboBox jcb = (JComboBox) e.getSource();
                String currentChoice = (String) jcb.getSelectedItem();
                setCurrentCreation(currentChoice);
            }
View Full Code Here

                i18n.get(UTMGridPlugIn.class, "resStrings.100m", " 100 meter "),
                i18n.get(UTMGridPlugIn.class, "resStrings.10m", " 10 meter "),
                i18n.get(UTMGridPlugIn.class, "resStrings.1m", " 1 meter ") };

        JComboBox resList = new JComboBox(resStrings);
        resList.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JComboBox jcb = (JComboBox) e.getSource();
                setDistanceGridResolution(jcb.getSelectedIndex());
                doPrepare();
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.