This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Applets and the fly likes applet problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "applet problem" Watch "applet problem" New topic
Author

applet problem

harsh garg
Ranch Hand

Joined: Jul 13, 2008
Posts: 33
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
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
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?


Ping & DNS - my free Android networking tools app
 
jQuery in Action, 2nd edition
 
subject: applet problem