Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

g.drawString() doesn't paint the text

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.awt.*;
import java.applet.Applet;
public class MyFirstApplet extends Applet {
public void pain(Graphics g) {
g.drawString("Hello",20,50);
}

}
// <applet code="MyFirstApplet" height=500 width=200> </applet>
Hello;
The problem I am having is, when I run the program using the appletviewer,
"Hello" doesn't get painted.
Why is this?
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am so sorry, I have misspelt the paint method.
I have written it as pain().
Sorry about it.
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic