-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.2
-
x86
-
linux
Name: kaC94536 Date: 01/19/2000
Graphics.drawString() method does not work correctly when environment variable
JAVA2D_USEPLATFORMFONT is not set.
Frame window of the following test contains container in container panel. This container
in its own paint(Graphics) method invokes Graphics.drawString().
When system environment variable JAVA2D_USEPLATFORMFONT is not set, you can see
a dot on the left upper corner of the container.
The same behavior is observed on Solaris.
As we see from JDK note, variable JAVA2D_USEPLATFORMFONT is now deprecated and will be
removed in the next build.
--------------------test.java---------------------------------------------
import java.awt.*;
class ctr extends Container {
public void paint(Graphics g) {
g.drawString("Lightweight Container", 10, getSize().height/2);
}
public Dimension getPreferredSize() {
return new Dimension(165, 40);
}
}
public class test extends Frame {
static Frame testFrame = null;
static Panel containerPanel;
public static void main(String[] argv) {
testFrame = new Frame("Lightweight Container Test");
testFrame.setSize(200, 100);
containerPanel = new Panel();
containerPanel.add(new ctr());
testFrame.add("Center", containerPanel);
testFrame.setVisible(true);
}
}
----------------------------------------------------------------------
$ java -version
java version "1.2.2"
Classic VM (build 1.2.2-L, green threads, javacomp)
======================================================================
======================================================================