wglMakeCurrent error with multiple vtk windows

We have a java application in which we are trying to utilize vtk. I have created a fairly simply MPR vtk pipeline using vtkImageResliceMapper and everything seems to work fine when I have just a single window using this pipeline, however, when I subsequently create a second window (i.e. viewport - not a vtk viewport) I get the following error msg when triggering a render request (around 90 of this same error msg happens all at once):

2025-08-31 15:58:15.551 ( 20.686s) [A9661B54375E57F9]vtkWin32OpenGLRenderWin:252 ERR| vtkWin32OpenGLRenderWindow (000001F439647E40): wglMakeCurrent failed in MakeCurrent(), error: The handle is invalid.(code 6)

The image seems to display ok and I am able to interact with it initially. We typically will create up to 4 of these viewports (standard 4 MPR views) and add some point, one or more of those viewports will just go blank when interacting with it. Each of these viewports has its own vtkRenderWindowPanel and related vtk objects. The only thing shared between them is the same vtkImageData object used as input. There is no additional error displayed when the viewport(s) go blank but I have no doubt it is related to the above error messages.

When having multiple vtkRenderWindowPanel’s in the same application, is there any sort of coordination that is required between them? Any idea of why those error messages are showing up? Any help would be greatly appreciated.

After some more debugging, I have found that the problem is related to some Swing/AWT component manipulation that our application is doing when adding new 3D rendering windows. It temporarily removes existing 3D windows from the Swing container via removeAll and then adds them back. Prior to removing them, the visibility on my vtk window is set to false and after adding it back, the visibility is set to true. It is actually at this point on the existing 3D vtk based window that the above wglMakeCurrent error shows up.

I am speculating that this Swing component manipulation is invalidating the window handle used by the underlying OpenGL context. Assuming this is the case, is there a VTK method to force the OpenGL context recreation or should I be disposing/recreating the vtkRenderWindow or any other suggestions?