Java JComboBox resetPhaseBox(JComboBox phaseBox)

Here you can find the source of resetPhaseBox(JComboBox phaseBox)

Description

refreshing the drop down to include phases of the selected schema by clearing out the previous items and adding new ones

License

Open Source License

Parameter

Parameter Description
phaseBox the phaseBox object which is to be reset.

Declaration

static void resetPhaseBox(JComboBox phaseBox) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.JComboBox;

public class Main {
    /**/*from  w  ww .j ava2 s .  c o m*/
     * refreshing the drop down to include phases of the selected schema by clearing out
     *  the previous items and adding new ones
     * @param phaseBox the phaseBox object which is to be reset.
     */
    static void resetPhaseBox(JComboBox phaseBox) {
        if (!phaseBox.isEnabled())
            phaseBox.setEnabled(true);

        while (phaseBox.getItemCount() != 1) {
            phaseBox.removeItemAt(phaseBox.getItemCount() - 1);
        }

    }
}

Related

  1. newCombo(int chars)
  2. prepareComboBox(JComboBox comboBox, Dimension size, int min, int max, int[] list)
  3. registerBrowseButtonListener(final JComboBox comboBox, final JButton button, final boolean chooseFile, final boolean isOpen, final FileFilter fileFilter, final File initialDirectory)
  4. removeAllListeners(JComboBox box)
  5. resetComboBoxInfo(JComboBox jComboBoxField, ArrayList comboBoxArray, String expression)
  6. setColorMenu(JComboBox choice)
  7. setComboBoxTheme(JComboBox comboBox)
  8. setErrorBackground(JComboBox comp)
  9. setJComboBoxAsHeavyweight(JComboBox combo)