Posted Tuesday, February 22, 2005 @ 08:25:45
Hi, and thanks in advance.
I'm using the DBTable in a Swing MDI application.
My problem is that I have an JInternalFrame with only a DBTable.
When I close it, the window never reaches the finalize method.
The rest of my JInternalFrames in the application reach it after disposing them.
This behaviour leads me to a Memory Leak, as user can open many times the same window.
As an easy test I have made a new project with a new JInternalFrame with a DBTable
and load it using the dBTable.refresh(Vector) method, where the Vector is a Vector
of Vectors. It works OK. Loads the DBTable and closing the JInternalFrame throws the finalize method.
The next test was to set the type of a Date field column to java.util.Date type, changing the
default type used by the DBTable. I use the next two methods after getting the whole DBTable loaded:
dBTable.getColumn(4).setType(java.sql.Types.DATE);
dBTable.getColumn(4).setDateFormat("dd/MM/yyyy");
Where 4 is the index of the column that has the Date field.
Now the DBTable is correctly loaded and the column 4 now shows the desired date format. The problem is that
now the finalize method is not thrown after disposing the JInternalFrame.
Taking out the second line (dBTable.getColumn(4).setDateFormat("dd/MM/yyyy");) only makes the table to show
the default date format, but the finalize method is not thrown.
If you want I can send you my java test files to prove it.