Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applet problem

 
harsh garg
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oftenly we create applet in different Html file....so with the help of web browser/appletviewer ,we execute our program.....but the following need not required any extra file...with in one single it executed very well
Steps are:-
1. javac sa.java
2.appletviwer sa.java
it generate correct output.anybody help me how this code generate correct output?
import java.awt.*;
import java.applet.*;
/* <applet code="sa" width=200 height=100>
</applet>*/

public class sa extends Applet
{
public void paint(Graphics g)
{
g.drawString("hello",640,360);
}
}
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you're asking. You state that the applet generates the correct output, and then you seem to ask how to make it generate the correct output? What is the correct output, and what does the code do now that's different from that?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic