<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>
&nbsp;private void openActionPerformed(java.awt.event.ActionEvent evt) {<br>
&nbsp;&nbsp;&nbsp; // TODO add your handling code here:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JFileChooser chooser = new JFileChooser();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chooser.showOpenDialog(this);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File file = chooser.getSelectedFile();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(file != null)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String fileName = file.getPath();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mainPanel.open(fileName);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //System.out.println(fileName);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
and then mainPanel, which is using vtkPanel to render the STL,<br>
&nbsp;public void open(String fileName)<br>
&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //this.setLayout(new BorderLayout());<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkSTLReader reader = new vtkSTLReader();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader.SetFileName(fileName);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //System.out.println(&quot;dalam fungsi&quot; + fileName);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkPolyDataMapper mapper = new vtkPolyDataMapper();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mapper.SetInput(reader.GetOutput());<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkActor actor = new vtkActor();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; actor.SetMapper(mapper);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //renWin.GetRenderer().AddActor(actor);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; renWin.GetRenderer().AddActor(actor);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; renWin.validate();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; renWin.repaint();<br>
&nbsp;&nbsp; }<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