in the java swing tablemodel, we are able to fire table changed, added, deleted etc. I am wondering if these method calls are expensive if the component is NOT in visibility?
For instance, another window is covering it. Or its in an non-active tab.
in the java swing tablemodel, we are able to fire table changed, added, deleted etc. I am wondering if these method calls are expensive if the component is NOT in visibility?
For instance, another window is covering it. Or its in an non-active tab.
I think is depends on the application itself on how to respond to these events.
Suppose you need to perform some kind of background tasks based on these event it would still be useful.
To minimize the impact of firing a large number of update events,
JTable
renderering uses the flyweight pattern to render only visible cells. The approach is outlined here. This related example scales well into the thousands of rows, but you should profile to verify the desired performance.As shown here, use
SwingWorker
to manage indeterminate latency.