I want to create custom component using swing. Also I want to connect database to that components.
What I want to do,
I want to create a custom JComboBox. That combo box name is warehouse. Also all warehouses in database should be bind to that combo box.
When I design a form I can use that combo box for warehouse. When I run the program all warehouse will be loaded to combo automatically. Because that combo has internal mechanism to load warehouses. (How do I write that thing?)
How do I do that?
I have done a similar thing working with a SQL Database.
Working with a database you need to make use of the ResultSet interface to run your query, and Statement class to create a statement.
This should populate the warehouse combo with the results from the query.