Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Delete cell factories

User_CDX3FJan 18 2013 — edited Jan 18 2013
I have a scene which shows a table with 2 columns. Each columns has its own cell factory class to render the cell value. When the table is rendered, the cell factory classes are created (one for each cell). Now when the user navigates to another scene, how to clear the memory allocated for the cell factory classes. I cleared the column data's , but how to remove each object created for each cell. I tried the following code, but it throws an error saying :
Caused by: java.lang.UnsupportedOperationException

	at com.sun.javafx.collections.UnmodifiableListSet$1.remove(UnmodifiableListSet.java:88)


My code to remove the objects alloted for cell factories:

      Set<Node> colNodes = mytableview.lookupAll("#columnname1");
        
       Iterator<Node> itr = colNodes.iterator();
            while(itr.hasNext()) {
                 Node n = itr.next();
                 colNodes.remove(n);
                //itr.remove();
            }

And same for column 2. but it throws an exception.
Any idea how to clear those objects.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 15 2013
Added on Jan 18 2013
1 comment
435 views