Skip to main content

JInternalFrame on Windows XP - Performance

1 reply [Last post]
pramod_patel
Offline
Joined: 2005-03-23

All,

I noticed that JInternalFrame's Windows L&F implementation sets the opaque property of JInternalFrame to false in case it is running in XP environment. This is probably done to get rounded borders on JInternalFrame. However, as a side effect when a new frame is openend or existing frames are activated or moved, most of the other internal frames are completely redrawn. Even in case the end result is such that the top most frame obscures other frames. The result is that new frames appear to take lot of time to paint in case there are other frames open. The performance degrades with number of existing frames.

Is there a way to workaround this problem? Is it possible to modify the behaviour such that only the top corners are redrawn and not the entire frames to achieve the round borders?

Refer to com.sun.java.swing.plaf.windowsWindowsInternalFrameUI for details:

LookAndFeel.installProperty(c, "opaque",
xp == null? Boolean.TRUE : Boolean.FALSE);

Pramod.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Scott Violet

Pramod,

The redraw you are seeing is required for transparent internal frames.
The easiest solution is to make them opaque, but this has the down side
of losing the windows look. Another non-trivial option is to maintain a
buffer per internal frame so that it's easy to composite when dragging.
This is a huge change though, and likely not one doable outside of Swing.

-Scott

swing@javadesktop.org wrote:
> All,
>
> I noticed that JInternalFrame's Windows L&F implementation sets the opaque property of JInternalFrame to false in case it is running in XP environment. This is probably done to get rounded borders on JInternalFrame. However, as a side effect when a new frame is openend or existing frames are activated or moved, most of the other internal frames are completely redrawn. Even in case the end result is such that the top most frame obscures other frames. The result is that new frames appear to take lot of time to paint in case there are other frames open. The performance degrades with number of existing frames.
>
> Is there a way to workaround this problem? Is it possible to modify the behaviour such that only the top corners are redrawn and not the entire frames to achieve the round borders?
>
> Refer to com.sun.java.swing.plaf.windowsWindowsInternalFrameUI for details:
>
> LookAndFeel.installProperty(c, "opaque",
> xp == null? Boolean.TRUE : Boolean.FALSE);
>
> Pramod.
> [Message sent by forum member 'pramod_patel' (pramod_patel)]
>
> http://forums.java.net/jive/thread.jspa?messageID=200478