SyntaxFix
Write A Post
Hire A Developer
Questions
If the string is empty, comboBox.getSelectedItem().toString() will give a NullPointerException. So better to typecast by (String).
comboBox.getSelectedItem().toString()
NullPointerException
(String)