Package javax.swing

Examples of javax.swing.JComboBox.addActionListener()


            models.put(drive, (FileSystemTreeModel) tree.getModel());
            cbDrives.addItem(drive)
        }
       
        cbDrives.setActionCommand("drvChanged");
        cbDrives.addActionListener(this);
        cbDrives.setSelectedIndex(0);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
View Full Code Here


            final JComboBox jcb = new JComboBox();
            for (int i = 0; i < NCOLORS; i++) {
                jcb.addItem(colorNames[i]);
            }
            jcb.setSelectedIndex(isFill ? fillColor : lineColor);
            jcb.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if (isFill)
                        fillColor = jcb.getSelectedIndex();
                    else
                        lineColor = jcb.getSelectedIndex();
View Full Code Here

            jcb.addItem("None");
            jcb.addItem("Arrow Forward");
            jcb.addItem("Arrow Back");
            jcb.addItem("Arrow Both");
            jcb.setSelectedIndex(arrowtype + 1);
            jcb.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    switch (jcb.getSelectedIndex()) {
                    case 0:
                        System.out.println("TestLayer: no arrows");
                        omline.addArrowHead(false);
View Full Code Here

                jcb.addItem("Straight");// indices correspond to
                                        // LineType.java
                jcb.addItem("Rhumb");
                jcb.addItem("Great Circle");
                jcb.setSelectedIndex(type - 1);
                jcb.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        setType((JComboBox) e.getSource());
                    }
                });
                pal.add(jcb);
View Full Code Here

                jcb.addItem("Straight");// indices correspond to
                                        // LineType.java
                jcb.addItem("Rhumb");
                jcb.addItem("Great Circle");
                jcb.setSelectedIndex(type - 1);
                jcb.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        setType((JComboBox) e.getSource());
                    }
                });
                pal.add(jcb);
View Full Code Here

            jcb.addItem("right");// indices correspond to values in
                                 // OMText
            jcb.addItem("center");
            jcb.addItem("left");
            jcb.setSelectedIndex(just);
            jcb.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    just = jcb.getSelectedIndex();
                    setList(generateGraphics());
                    repaint();
                }
View Full Code Here

            JPanel viewPanel = PaletteHelper.createPaletteJPanel("View Type");
            String[] viewStrings = { "None", "Shading", "Elevation Shading",
                    "Elevation Bands (Meters)", "Elevation Bands (Feet)" };

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

        jcb = new JComboBox();
        jcb.addItem("LatLon");// indices correspond to LineType.java
        jcb.addItem("XY");
        jcb.addItem("Offset");
        jcb.setSelectedIndex(obj.rt - 1);
        jcb.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                obj.setRender(jcb);
                switch (obj.rt) {
                case OMGraphic.RENDERTYPE_LATLON:
                    jframe.setTitle(title + " - LatLon");
View Full Code Here

            Task next = possiblePredecessors[i];
            comboBox.addItem(new DependencyTableModel.TaskComboItem(next));

        }

        comboBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (predecessorTable.getEditingRow() != -1) {
                    DependencyTableModel.TaskComboItem selectedItem = (DependencyTableModel.TaskComboItem) comboBox
                            .getSelectedItem();
                    if (selectedItem != null) {
View Full Code Here

    DCPanel buttonPanel = new DCPanel();
    buttonPanel.setLayout(new HorizontalLayout(4));

    if (highlightedColumns.length == 1 && inputColumns.size() > 1) {
      final JComboBox comboBox = new JComboBox(VIEWS);
      comboBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          if (comboBox.getSelectedItem() == VIEWS[0]) {
            applyDetailedView(table, result);
          } else {
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.