I have a window containing a Power Table component.
This power table needs to display images (stored as SQL blobs) in one particular column.
Based on scripts from this forum (jdfrankston) i have the following script firing on the power table "cellUpdate" event that creates a JComponent in the cell, and also scales the image to fit.
def configureCell(self, value, textvalue, selected, rowIndex, colIndex, colName, rowView, colView)
if colName == "alarmimage" and value != None:
The client is slow and lagging all the time when this particular window is opened (even when no data is updating)
The byte-size of the images does not seem to make a imact. Even small images (10 kB) creates this problem.
When using the controls on the PoweTable, the cellUpdate script fires "continously", But the performance issue seems to be present even when the script is not firing.
Do you have any animation or other object layered on top of this table? That will trigger many repaint events, which will each have to call your function for any visible rows.
You could keep a dictionary there that holds the JLabel instance for every image URL, and pass that when queried (or calculate a new JLabel when it’s queried for the first time).
It’s very easy to make the cellUpdate code too slow, as that’s executed for every cell repaint.
The problem is those imports happening for every cell on every repaint.
Move the code that generates the image into a project script and then call that function from configureCell.