[vtkusers] Mantain VTK interactor functionalities in Java (with Swing)

Sebastien Jourdain sebastien.jourdain at kitware.com
Fri Apr 22 08:11:18 EDT 2011


Hi Arturo,

the code should look like that instead. (I did it by memory so the
method name may not be fully correct)

> javaframe.getContentPane().setLayout(new BorderLayout());
> JPanel javaPanel = new JPanel();
> javaPanel.setLayout(new BorderLayout());
> vtkCanvas vPanel = new vtkCanvas();
> vtkRenderWindowInteractor iren = vPanel.getIren();
> iren.SetInteractorStyle(new vtkInteractorStyleImage());
>
> plane.SetCurrentRenderer(vPanel.GetRenderer());
> plane.SetInteractor(iren);
> plane.On();
>
> javaPanel.add(vPanel, BorderLayout.CENTER);
> javaframe.getContentPane().add(javaPanel, BorderLayout.CENTER);
> javaFrame.setVisible(true);

Seb



More information about the vtkusers mailing list