Java JComboBox Value getCmbValue(JComboBox cmb)

Here you can find the source of getCmbValue(JComboBox cmb)

Description

get Cmb Value

License

Open Source License

Declaration

public static Object getCmbValue(JComboBox cmb) 

Method Source Code

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

import javax.swing.JComboBox;

public class Main {
    public static Object getCmbValue(JComboBox cmb) {
        Object item = cmb.getSelectedItem();
        if (item instanceof String) {
            return null;
        } else {/*from   w ww .  jav  a2 s.  c  o  m*/
            return item;
        }
    }
}

Related

  1. containsValue(JComboBox comboBox, String value)
  2. createComboBox(ActionListener actionListener, Vector values, String command)
  3. createComboBox(final Preferences node, final String pref_name, final String[] options, final String default_value)
  4. createStandardCombo(String[] values)
  5. fillValue(Vector vtData, int iComboIndex, int iVectorIndex, JComboBox cbo, Vector vt, boolean bClear, boolean bHaveNull)
  6. getDouble(javax.swing.JComboBox input)
  7. getIfHasValue(Object val, JComboBox cb)
  8. getInt(JComboBox combo)
  9. IsComboBoxModified(JComboBox comboBox, Object originalValue)