Here you can find the source of getCmbValue(JComboBox cmb)
public static Object getCmbValue(JComboBox cmb)
//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; } } }