I have a separate class that implements a TableModel interface used for JTable. I have one Boolean column, presented as a column of checkboxes and I was wondering how I can inform an external object that certain values need to be updated? If I had this implementation as a nested class, I could access the members of the main class from within, but if I decided to move it to a separate class, do I need to register my main class as a listener on the Table model implementation and then raise an event?
Expanding on @gontard's correct answer, you can arrange for your view (say a CombinedDomainXYPlot
) to listen to your TableModel
. Both known subclasses include the required addTableModelListener()
implementation. Your view can then react accordingly when it sees the change.