Hi Seb,<div>         Thanks for the reply. All the operations that I am doing are in a single thread. And I am using the javax.swing.SwingUtilities.invokeLater() syntax in the main function. </div><div>          More about the error :: When the error occurred the image that is being displayed in vtkCanvas is becoming full white.  But vtkImageData is not corrupted/null. </div>
<div><br></div><div>The Lines where the error is occurring </div><div>               panel1.remove(vtkCanvasObject);</div><div>              <i><b> panel2.add(vtkCanvasObject);</b></i></div><div><br></div><div>Thanks a lot.</div>
<div><br></div><div>Best Regards,</div><div>Satya.</div><div><div><br></div><br><div class="gmail_quote">On Tue, Jul 17, 2012 at 8:20 AM, Sebastien Jourdain <span dir="ltr">&lt;<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Did you make sure you were performing those operation within the EDT ?<br>
If yes, then don&#39;t do what you are doing. Find another way...<br>
<div class="im"><br>
On Tue, Jul 17, 2012 at 12:16 AM, satyanarayana reddy<br>
&lt;<a href="mailto:satyajanga@gmail.com">satyajanga@gmail.com</a>&gt; wrote:<br>
</div><div><div class="h5">&gt; Hi vtkusers,<br>
&gt;            I have a vtkCanvas object which renders  vtkImageData and it is<br>
&gt; working absolutely fine.<br>
&gt;            My application consists of a JFrame with JTabbedPane in it. A<br>
&gt; Simple requirement in my application is that whenever a tab gets selected I<br>
&gt; have to remove the vtkCanvas object from the previous active tab and add it<br>
&gt; to the current active tab. When I am trying to do it I am getting the<br>
&gt; following error.<br>
&gt;<br>
&gt;<br>
&gt; wglMakeCurrent failed in MakeCurrent(), error: handle Invalid()<br>
&gt;<br>
&gt; Please give me some pointers about where I am doing wrong.<br>
&gt;<br>
&gt; Thanks a lot<br>
&gt;<br>
&gt; Best Regards,<br>
&gt; Satya.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
</blockquote></div><br></div>