Java JComboBox resetComboBoxInfo(JComboBox jComboBoxField, ArrayList comboBoxArray, String expression)

Here you can find the source of resetComboBoxInfo(JComboBox jComboBoxField, ArrayList comboBoxArray, String expression)

Description

reset Combo Box Info

License

Open Source License

Declaration

private static void resetComboBoxInfo(JComboBox<String> jComboBoxField, ArrayList<String> comboBoxArray,
            String expression) 

Method Source Code


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

import javax.swing.*;

import java.util.ArrayList;

public class Main {
    private static void resetComboBoxInfo(JComboBox<String> jComboBoxField, ArrayList<String> comboBoxArray,
            String expression) {//from   ww  w. jav  a  2  s  .  c  om
        if (comboBoxArray.contains(expression)) {
            jComboBoxField.setSelectedItem(expression);
        } else {
            jComboBoxField.setSelectedItem(expression.substring(expression.indexOf(".") + 1, expression.length()));
        }
    }
}

Related

  1. makeSquare(JComboBox... comboBoxes)
  2. newCombo(int chars)
  3. prepareComboBox(JComboBox comboBox, Dimension size, int min, int max, int[] list)
  4. registerBrowseButtonListener(final JComboBox comboBox, final JButton button, final boolean chooseFile, final boolean isOpen, final FileFilter fileFilter, final File initialDirectory)
  5. removeAllListeners(JComboBox box)
  6. resetPhaseBox(JComboBox phaseBox)
  7. setColorMenu(JComboBox choice)
  8. setComboBoxTheme(JComboBox comboBox)
  9. setErrorBackground(JComboBox comp)