<br clear="all">hi all,<br>
<br>
i'm newbie in VTK. now i'm using java.1.5 and vtk4.2 for my application.<br>
i have problem when rendering the STL file.<br>
first, i using GUI to select the STL file,<br>
private void openActionPerformed(java.awt.event.ActionEvent evt) {<br>
// TODO add your handling code here:<br>
JFileChooser chooser = new JFileChooser();<br>
chooser.showOpenDialog(this);<br>
<br>
File file = chooser.getSelectedFile();<br>
if(file != null)<br>
{<br>
String fileName = file.getPath();<br>
<br>
mainPanel.open(fileName);<br>
//System.out.println(fileName);<br>
}<br>
}<br>
<br>
and then mainPanel, which is using vtkPanel to render the STL,<br>
public void open(String fileName)<br>
{<br>
//this.setLayout(new BorderLayout());<br>
vtkSTLReader reader = new vtkSTLReader();<br>
reader.SetFileName(fileName);<br>
//System.out.println("dalam fungsi" + fileName);<br>
<br>
vtkPolyDataMapper mapper = new vtkPolyDataMapper();<br>
mapper.SetInput(reader.GetOutput());<br>
<br>
vtkActor actor = new vtkActor();<br>
actor.SetMapper(mapper);<br>
<br>
//renWin.GetRenderer().AddActor(actor);<br>
renWin.GetRenderer().AddActor(actor);<br>
<br>
renWin.validate();<br>
renWin.repaint();<br>
}<br>
<br>
when i try to open the STL file, it's fine.<br>
but the problem comes when i try to open other STL file.<br>
the first STL image don't changed with the second STL image, but they together in one window.<br>
how to make the second STL image replacing the first STL image?<br>
<br>
thank's for your responese..<br>
<br>
-- <br>--Y!M: ekaditya