-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
None
-
b26
-
generic
-
linux
Name: rpR10076 Date: 09/12/2003
Please see included test. It consists of one
frame and a canvas.
When run with MToolkit, or WToolkit, it first
appears red. With XAWT, it first appears grey
and only turns red if you resize the window.
It is arguable whether the test is valid (it
isn't a good thing to set background within
paint() method), but I copied it from a real
test case for another bug, so I believe people
do that, and they may be disappointed with
the fact that XAWT behaves inconsistently in
this situation.
=== test program ===
import java.awt.*;
public class PaintBug extends Frame {
private PaintBugCanvas fpc;
public PaintBug() {
fpc = new PaintBugCanvas();
add(fpc);
}
public static void main(String[] args) {
PaintBug fp = new PaintBug();
fp.pack();
fp.show();
}
}
class PaintBugCanvas extends Canvas {
public PaintBugCanvas() {
setSize(200,200);
}
public void paint(Graphics g) {
setBackground(Color.red);
g.drawString("I should be red", 20, 20);
}
}
=== test program ===
======================================================================
- relates to
-
JDK-4938695 XAWT-painting inconsistency & flickering problem
-
- Resolved
-
-
JDK-4906548 RH9: Redraw problem with Style, Font on AWT component
-
- Closed
-