I've created a JFrame with JDesktop and one JInternalFrame on it. I've also added a glasspane (which draws a black circle only) to JFrame - it's invisible by default but when I resize JInternalFrame it shows up.. is this correct behavior? Why it is visible only when I resize and diappears when I release mouse button after resize? How I can make it invisible when resizing JInternalFrame? (Is removing JFrame's glasspane only solution?)After almost 2 days I've got no response here so I'm posting this on Sun's forum
This is the reply:
Darryl.Burke wrote:Whether this is "correct" behavior or not may be debatable, but it's certainly expected behavior. From the source of javax.swing.plaf.basic.BasicInternalFrameUI.BorderListener.mousePressed (towards the end of the method)The glass pane is made visible to show the resize cursor.
It's set back to visible(false) in finishMouseReleased() which is invoked from mouseRelease and elsewhere (e;g; from cancelResize which is invoked from windowLostFocus)
Looks like you can't use the glass pane for whatever you had planned, the Swing designers have already used it for something else. Or this could be a workaround, depending on exactly what it is you're trying to do.You could also declare and use a boolean flag, rather than using isOpaque (which may happen to be set/reset somewhere else in the Swing code ;-)