• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bug in Sun's Java SE 1.3 Graphics.setFont?

 
Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everything works fine in the appletviewer. I compile an applet under JavaSE 1.3 that
uses Graphics.setFont and under
1. Netscape 4.75 it seems to have no effect.
2. IE 5.5 it hangs the applet
So I then use J++ V6 and it works. Is this a bug in Sun's Java Standard Edition 1.3?
Can you make this source code work with any browser?
--------------------------------------------------------------------------
import java.awt.*;
import java.applet.*;
/**
* setFontApplet.java
*
*
* Created: Sat Aug 19 10:53:40 2000
*
* @author
* @version
*/
public class setFontApplet extends Applet {

public setFontApplet() {
first = true;
}
public void init(){
}
public void paint(Graphics g){
if(first){
font = g.getFont();
font = new Font(msg=font.getFontName(),Font.BOLD,20);
g.setFont(font);
ascent = g.getFontMetrics().getAscent();
first = false;
}
else{
g.setFont(font);
}
g.drawString("font = "+msg,0,ascent);
}
private boolean first=true;
private Font font;
private int ascent;
private String msg;
} // setFontApplet
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!