[vtkusers] Java RemoveActors

Richard Haney cosmoh2o at hotmail.com
Sat Aug 13 09:54:27 EDT 2005


I am trying to build a Java Swing application that utilizes the VTK and have 
been successful except for when I try to remove a pre-existing actor. When I 
try, the application freezes. Has anyone ran into this problem and if so, 
how did you solve it?

I am using VTK42 and JDK 1.4.0.

A small sample of the code I am using follows:
(renWin is a reference to vtkPanel and actor is a reference to vtkActor 
object)

if (actor != null) {
  renWin.GetRenderer().RemoveActor(actor);
  // Force garbage collection!!
  System.gc();
}

Thanks to anyone with any ideas on how to solve this.





More information about the vtkusers mailing list