-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta
-
generic
-
generic
ingrid.yao@Eng 2000-08-17
Compatibility bug reported by CAP program members, I also can
reproduce the same problem on Solaris merlin release. it works fine on
JDK 1.3 for Solaris ri, Solaris production and Win32.
Java 2 SDK, Standard Edition, v 1.4.0 Compatibility Associate Program (CAP) Bug Report Form
Version: 1.4.0-Cap
J2SE_Version: 1.4.0beta-b26
Does_this_problem_occur_on_J2SE_1.3: No
Operating_System_Configuration: Windows 2000
Hardware_Configuration: Athelon 650MHz, 256MB RAM, NVIDIA RIA TNT2 Model 64(32bit mode)
Bug_Description: Setting Stroke on Graphics2D obtained from BufferedImage
doesn't work correctly.
Steps_to_Reproduce: Try to run the following code once as it is
and once with the alternative paint method
enabled. Code that uses BufferedImage draws solid box.
And code that doesn't use BufferedImage draws
dashed box.
import java.awt.*;
import java.awt.image.*;
public class Test {
public static void main(String[] argv) {
Frame f = new Frame() {
public void paint(Graphics g) {
BufferedImage buf = new BufferedImage(300, 300, BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = buf.createGraphics();
g2d.setColor(Color.white);
g2d.fillRect(0, 0, 300, 300);
g2d.setColor(Color.black);
g2d.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_MITER, 10.0f, new float[] {2.5f, 3.5f},
0.0f));
g2d.drawRect(10, 10, 200, 200);
g.drawImage(buf, 0, 50, this);
}
/*
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(Color.white);
g2d.fillRect(0, 0, 300, 300);
g2d.setColor(Color.black);
g2d.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_MITER, 10.0f, new float[] {2.5f, 3.5f},
0.0f));
g2d.drawRect(10, 50, 200, 200);
}
*/
};
f.setBounds(10, 10, 400, 400);
f.show();
}
}