Hello guys i want to show a data in my combobox when i click on an item ion my jtable
i tried this but it doesn't work. i would apprecite it if any one can help thanx

 String add5 = rs.getString("Id_branch");
                branch_combo.setSelectedItem(add5);

 String add6 = rs.getString("User_Role");
                UserRole_combo.setSelectedItem(add6);

Recommended Answers

All 2 Replies

what exactly are you trying to do and what do you mean by "doesn't work".
do you know what 'setSelectedItem' does?

Did you try printing add5 and add6 to confirm that they contain the expected values?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.