-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.2.2
-
x86
-
windows_nt
Name: rlT66838 Date: 07/16/99
Hi.
It is so hot in South Korea.
My name is Sung-eun Yang. Glad to meet you.
* I have found a problem, using Graphics's method, seem to be a bug.
Following simple example code is proposed to be act below.
1. At the beginning of its run, nothing will be painted in the Frame.
2. Once you press a mouse button inside the Frame, a red filled Box would appear.
import java.awt.*;
import java.awt.event.*;
public class Test extends Component {
public Test() {
enableEvents(AWTEvent.MOUSE_EVENT_MASK);
}
public void processMouseEvent(MouseEvent e) {
if (e.getID() == MouseEvent.MOUSE_PRESSED) {
System.out.println("mouse pressed");
Graphics g = getGraphics();
g.setColor(Color.red);
g.fillRect(10,10,50,50);
}
}
public static void main(String[] args) {
Frame f = new Frame();
f.add(new Test());
f.setLocation(300,450);
f.setSize(200,150);
f.setVisible(true);
}
}
* Problem is: *
The drawing methods of Graphics -fillRect()... - didn't any effective work(anything)
on it's first call involved by first mouse pressing.
but, on it's second call, these methods did work properly.
Mouse event was properly delivered, thus I think that the methods of Graphics
contain bug...
*[java -version]
java version "1.2.1"
Classic VM (build JDK-1.2.1-A, native threads)
* windows NT 4 (Service pack 3)
Please, reply to me.
Have a nice day.
Thanks.
(Review ID: 85676)
======================================================================