Hi, I am having a challenge with this.. I just read a book on Java Applet and there is something that is confusing to me. i need help on that..

There are two programs here...

import java.awt.Graphics;
import java.swing.JApplet;

public class TryMe extends JApplet {

public void paint (Graphics g)

g.drawString ("Welcome", 350, 100)


The other one is :

<Applet Code="TryMe.class">

Where am i going to save the second code and also how exactly do i execute this code so that i can see the string on my Browser of AppletViewer?


there are a number of errrors here:
1. its

import javax.swing.JApplet;


import java.swing.JApplet;

2. theres a missing ; after your drawString
3. your HTML file shouldnt have the <JApplet> tag. Use <applet> instead. And remember to open and close your tags.
4. when closing tags, it shouldnt be <\HTML> it should be </HTML>

the second code will be saved in a .html file, in the same directory as your .class file (which you have to obviously compile first).