Hello Experts,
I'm facing this issue in Java Swing. A created a new java class that extends JFrame, added a JPanel, and added the following components:
1- JTextField
2- JButton
3- JCombox
- I enter in the JTextField a value representing a department name, and then I click on the button.
- The button's event handler retrieves the list of employees in the department by executing an SQL statement. The employees are successfully being returned (verified on the console / log).
- the combobox should now be updated with the list of employees, however it's not.
What I'm looking for is a way to update the combobox in correspondence with the department name entered in the JTextField. Instead, the combo box remains empty.
I googled it and found many advising to use 'revalidate' / 'repaint' / 'update', ..... but nothing really works.
Any advice is highly appreciated.
many thanks in advance.