I have a JPanel “presentation” with a JComboBox. This JComboBox takes elements from a database. I have another JPanel “insert” in which I insert database elements.
If I insert a new database element, I’d like “presentation” JPanel combobox updates with the newly inserted element. Is this possible?
Yes. Use a model to populate your presentation JComboBox. Populate the model from the database to start your process.
When you insert a new database element, you also insert that value into your presentation JComboBox model. Updating the model will update the JComboBox.
Here’s an example that would load a ComboBoxModel from a database.
Then later, you would just