I have been reading the forums extensively and tried numerous methods on how to solve this problem.
The Problem:
I made a custom AbstractTableModel
so I can control the way my data is displayed. It is simply stored in a String[][]
. It connects to a DB using JDBC
to populate the initial data. So, when my user (through the Swing
GUI) searches for a something, behind the scenes I simply construct a query to query the DB and it returns a ResultSet
. Now, I want to display this new Data on the JTable
.
Research:
I read a lot about listeners and firing updates and things. But I have read and reread them and still do not completely understand them. When I set a new model to the JTable
, I actually want to KEEP my custom AbstractTableModel
I created and just update the data, is this possible (maybe with public methods inside AbstractTableModel
class that I can create)?
Additional Questions: Should I be using a listener for this functionality? Do I need to add listeners or observers?
Thanks, I really appreciate it! Rich