aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Why Glass Pane becomes visible when resizing JInternalFrame? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Why Glass Pane becomes visible when resizing JInternalFrame?" Watch "Why Glass Pane becomes visible when resizing JInternalFrame?" New topic
Author

Why Glass Pane becomes visible when resizing JInternalFrame?

Bartek Myszkowski
Ranch Hand

Joined: Feb 03, 2009
Posts: 44
Hello,
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
Bartek Myszkowski
Ranch Hand

Joined: Feb 03, 2009
Posts: 44
Just if someone would like to know.. I've got reply on Sun's forum (I've marked this is cross-posting on both forums)

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 ;-)

db
luri ron
Ranch Hand

Joined: Dec 11, 2008
Posts: 87
i don't think the proposed solution work.... just curiouse, do you come up with other way to deal with the glasspane?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

luri ron wrote:i don't think <snip/>

There, corrected it.


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Glass Pane becomes visible when resizing JInternalFrame?