Package javax.swing

Examples of javax.swing.DefaultComboBoxModel


    private void init() {
        setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
        setBorder(makeBorder());
        add(makeTitlePanel());

        DefaultComboBoxModel styleModel = new DefaultComboBoxModel();
        styleModel.addElement(BYNUMBER_LABEL);
        styleModel.addElement(BYPERCENT_LABEL);
        styleBox = new JComboBox(styleModel);
        styleBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (((String) styleBox.getSelectedItem()).equals(BYNUMBER_LABEL)) {
                    style = ThroughputController.BYNUMBER;
View Full Code Here


        return mainPanel;
    }

    private JPanel createHTTPSamplerPanel() {
        DefaultComboBoxModel m = new DefaultComboBoxModel();
        for (String s : HTTPSamplerFactory.getImplementations()){
            m.addElement(s);
        }
        samplerTypeName = new JComboBox(m);
        samplerTypeName.setSelectedIndex(0);
        samplerTypeName.addItemListener(this);
        JLabel label2 = new JLabel(JMeterUtils.getResString("proxy_sampler_type")); // $NON-NLS-1$
View Full Code Here

        return panel;
    }

    private JPanel createTargetPanel() {
        targetNodesModel = new DefaultComboBoxModel();
        targetNodes = new JComboBox(targetNodesModel);
        targetNodes.setActionCommand(CHANGE_TARGET);
        // Action listener will be added later

        JLabel label = new JLabel(JMeterUtils.getResString("proxy_target")); // $NON-NLS-1$
View Full Code Here

        return panel;
    }

    private JPanel createGroupingPanel() {
        DefaultComboBoxModel m = new DefaultComboBoxModel();
        // Note: position of these elements in the menu *must* match the
        // corresponding ProxyControl.GROUPING_* values.
        m.addElement(JMeterUtils.getResString("grouping_no_groups")); // $NON-NLS-1$
        m.addElement(JMeterUtils.getResString("grouping_add_separators")); // $NON-NLS-1$
        m.addElement(JMeterUtils.getResString("grouping_in_controllers")); // $NON-NLS-1$
        m.addElement(JMeterUtils.getResString("grouping_store_first_only")); // $NON-NLS-1$
        m.addElement(JMeterUtils.getResString("grouping_in_transaction_controllers")); // $NON-NLS-1$
        groupingMode = new JComboBox(m);
        groupingMode.setSelectedIndex(0);
        groupingMode.addItemListener(this);

        JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode")); // $NON-NLS-1$
View Full Code Here

  ComboStringEditor()
  {
    // Create the combo box we will use to edit this property:

    model= new DefaultComboBoxModel();
    model.addElement(UNDEFINED);
    model.addElement(EDIT);

    combo= new JComboBox(model);
    combo.addItemListener(this);
View Full Code Here

        txtMaxMemory = new XBayaTextField();
        txtCpuCount = new XBayaTextField();
        txtProcessorsPerNode = new XBayaTextField();
        txtNodeCount = new XBayaTextField();

        DefaultComboBoxModel cmbModelJobType = new DefaultComboBoxModel(getJobTypesAsStrings());
    cmbJobType = new XBayaComboBox(cmbModelJobType);
        cmbJobType.setEditable(false);
        //FIXME:: Machines like trestles are mandating to have cpu and node types set. So better to have these enabled.
//        cmbJobType.getSwingComponent().addActionListener(new ActionListener(){
//      @Override
View Full Code Here

        presetLabel.setDisplayedMnemonic('p');
        controlsPane.add(presetLabel);

        presetComboBox = new JComboBox();
        presetLabel.setLabelFor(presetComboBox);
        DefaultComboBoxModel presetModel = (DefaultComboBoxModel)presetComboBox.getModel();
        presetModel.addElement(null);
        for(String presetName : presets) {
            presetModel.addElement(presetName);
        }
        presetComboBox.setRenderer(new DefaultListCellRenderer() {
            @Override
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
View Full Code Here

    private void initComponents() {

        midiInComboBox = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();

        midiInComboBox.setModel(new DefaultComboBoxModel(availableMIDIIns.keySet().toArray(new String[0])));
        midiInComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                midiInComboBoxActionPerformed(evt);
            }
        });
View Full Code Here

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                outputTypeChanged(evt);
            }
        });

        comComboBox.setModel(new DefaultComboBoxModel(moppydesk.outputs.MoppyCOMBridge.getAvailableCOMPorts()));
        comComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comComboBoxActionPerformed(evt);
            }
        });

        midiOutComboBox.setModel(new DefaultComboBoxModel(controlWindow.availableMIDIOuts.keySet().toArray(new String[0])));
        midiOutComboBox.setEnabled(false);
        midiOutComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                midiOutComboBoxActionPerformed(evt);
            }
View Full Code Here

        setTitle("Moppy Floppy Simulator");
        setMinimumSize(new java.awt.Dimension(500, 350));

        jLabel1.setText("Listen on:");

        comComboBox.setModel(new DefaultComboBoxModel(app.getAvailableCOMPorts()));
        comComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comComboBoxActionPerformed(evt);
            }
        });
View Full Code Here

TOP

Related Classes of javax.swing.DefaultComboBoxModel

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.