Java: Can display in a JFrame but get black screen in a JDialog

Working off of the Java samples I'm able to load and display CAD files within a JFrame but I get just a black screen when I try to do the same exact thing using the same code within a JDialog. It still tells me the number of loaded entities after loading the file and when I click and drag on the panel it still displays the selection rectangle but the panel is black and doesn't display the loaded entities. Does anyone have any idea what might cause this or if there's a way around it? Thanks.

barker.m.5's picture

It looks like this isn't a problem with JDialog at all but with creating the V3d_Viewer and Ais_InteractiveContext and not displaying them until later. Haven't exactly found a way around this though. So for example if I initialize the viewer in the JDialog and display it at the same time then it works fine. If I initialize the viewer and then later set the JDialog to visible then I get the black screen.

barker.m.5's picture

I've also noticed that if part of viewer is off the screen when it's first displayed then that portion of the viewer will be black.