• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why drawString method cannot be print out?

 
kakashi blue
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public void paint(Graphics g)
{
int currentFace = Font.FACE_SYSTEM;
int height = 0;
g.setColor(255,255,255);
g.fillRect(0, 0, getWidth(),30);

g.setFont(Font.getFont(currentFace,
Font.STYLE_PLAIN,
Font.SIZE_LARGE));
g.drawString("Regular plain", 0, height, Graphics.TOP|Graphics.LEFT);
height += g.getFont().getHeight();
}
What shld i do to print out the Regular plain?
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears that you are working with an applet. I will move this post to the applets forum for you.
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I can't tell whether it's an applet or an application. Either way would work the same. I hate to do a "double-bounce", but I think this question would get better answers in the AWT/JFC/Swing forum.
BTW, we have a naming policy here at the JavaRanch in order to fool people into thinking we're a bunch of suave, sophisticated professionals. You can find out more here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic