DataType varName = (DataType)comboBox.getSelectedItem(); String value = comboBox.getSelectedItem().toString();