-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.0.2, 1.1.4, 1.1.8
-
generic, x86, sparc
-
solaris_2.5.1, windows_nt
Resizing a frame/panel causes too many repaints, thereby making the screen flicker badly. This situation is particularly aggravated if a font is set in a panel. It will cause more repaints than if the font was not set.
=============================================================================
daniel.indrigo@Canada 1997-08-13
The window appears to get too many repaints when it is resized, but not always. It most often occurs when resizing by moving the top of the window.
There appear to be at least two other bugs related to this problem, 4024555 and 1226539
Following is a description of the bug and a test case from ###@###.###
When resizing a window outwards, the contents flash and repaint
repeatedly (oddly, it only happens when growing the window, not
shrinking.) The problem is exacerbated when using lightweight
components, as they are repainted with the rest of the window.
No workarounds are currently known.
TEST CASE
---------
import java.awt.*;
public class ResizeLW extends Frame
{
public ResizeLW()
{
setBackground(Color.red);
}
public static void main(String args[])
{
Frame f = new ResizeLW();
f.setLayout(new FlowLayout());
f.setBounds(10, 10, 300, 300);
for (int i = 0; i < 10; i++)
{
f.add(new ColorComp(Color.blue));
f.add(new ColorComp(Color.green));
}
f.setVisible(true);
}
static private class ColorComp extends Component
{
public ColorComp(Color c)
{
super();
setBackground(c);
}
public void paint(Graphics g)
{
g.setColor(getBackground());
g.fillRect(0,0,50,50);
}
public Dimension getPreferredSize()
{
return new Dimension(50, 50);
}
}
}
=============================================================================
daniel.indrigo@Canada 1997-08-13
The window appears to get too many repaints when it is resized, but not always. It most often occurs when resizing by moving the top of the window.
There appear to be at least two other bugs related to this problem, 4024555 and 1226539
Following is a description of the bug and a test case from ###@###.###
When resizing a window outwards, the contents flash and repaint
repeatedly (oddly, it only happens when growing the window, not
shrinking.) The problem is exacerbated when using lightweight
components, as they are repainted with the rest of the window.
No workarounds are currently known.
TEST CASE
---------
import java.awt.*;
public class ResizeLW extends Frame
{
public ResizeLW()
{
setBackground(Color.red);
}
public static void main(String args[])
{
Frame f = new ResizeLW();
f.setLayout(new FlowLayout());
f.setBounds(10, 10, 300, 300);
for (int i = 0; i < 10; i++)
{
f.add(new ColorComp(Color.blue));
f.add(new ColorComp(Color.green));
}
f.setVisible(true);
}
static private class ColorComp extends Component
{
public ColorComp(Color c)
{
super();
setBackground(c);
}
public void paint(Graphics g)
{
g.setColor(getBackground());
g.fillRect(0,0,50,50);
}
public Dimension getPreferredSize()
{
return new Dimension(50, 50);
}
}
}
- duplicates
-
JDK-4207632 Regression test FramePaintTest.html Failing
- Closed
- relates to
-
JDK-4024555 scrollpane generating unnecessary paint calls to child when resized smaller
- Closed
-
JDK-1226539 by a resize of a applet with the mouse ,the paint method is called several times
- Closed