Package javax.swing

Examples of javax.swing.MutableComboBoxModel


    }

    public void removeElementAt(int anIndex)
    {
        checkMutableComboBoxModel();
        MutableComboBoxModel model = (MutableComboBoxModel)getComboBoxModel();
        model.removeElementAt(anIndex);
    }
View Full Code Here


    }

    public void removeElement(Object anObject)
    {
        checkMutableComboBoxModel();
        MutableComboBoxModel model = (MutableComboBoxModel)getComboBoxModel();
        model.removeElement(anObject);
    }
View Full Code Here

            attributes.setEnabled(false);
        }
        else {

            attributes.setEnabled(true);
            MutableComboBoxModel model = new DefaultComboBoxModel(pkAttributes.toArray());
            String noSelection = "<Select Generated Column>";
            model.insertElementAt(noSelection, 0);
            model.setSelectedItem(noSelection);
            attributes.setModel(model);

            for (DbAttribute a : pkAttributes) {
                if (a.isGenerated()) {
                    model.setSelectedItem(a);
                    break;
                }
            }

            // listen for selection changes of the new entity
View Full Code Here

     */
    private void setPointSizeItems(double value) {
        pointSize = (float) Math.max(0.0, value);
        int newValue = (int)pointSize;

        MutableComboBoxModel model = (MutableComboBoxModel) pointSizeCBox.getModel();
        int insert = -1;
        for (int i = 0; i < model.getSize(); i++) {
            int elValue = ((Number)model.getElementAt(i)).intValue();
            if (elValue == newValue) {
                pointSizeCBox.setSelectedIndex(i);
                return;

            } else if (elValue > newValue) {
                insert = i;
                break;
            }
        }

        if (insert < 0) {
            insert = model.getSize();
            model.addElement(Integer.valueOf(newValue));
        } else {
            model.insertElementAt(Integer.valueOf(newValue), insert);
        }
        pointSizeCBox.setSelectedIndex(insert);
    }
View Full Code Here

                {
                    m_command_tf.setText( text );
                }
                else if(host_box_tf.hasFocus() )
                {
                    MutableComboBoxModel model = (MutableComboBoxModel)
                        m_host_box.getModel();

                    model.addElement( text );
                    model.setSelectedItem( text );
                }
            }
        }
        catch( Exception e)
        {
View Full Code Here

TOP

Related Classes of javax.swing.MutableComboBoxModel

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.