Hi all,
i want to ask u guys what else i need to do to run this code?
i have JDK. i have these file in my c:/program files/java/jdk1.6.0_16
c:/program files/java/jdk1.6.0_18 c:/program files/java/jre6.


if i want to run this code,what do i need to do?

import java.awt.graphics;

class HelloWorldApplet extends java.applet.Applet
{
	public void paint(Grphics g)
	{
		g.drawingString("Hello World!!!",5,25);
	}
}

do i need to save the helloworld file inside c:/program files/java ?

im a new leaner...im reading a book teach yourself java in 21 days.but a bit conufse about the compiler or interpreter...

:'(

1. If teach yourself java in 21 days telling you to save things in installation of Java throw in the bin. If it was your idea smack your self on hand. Do not mess with installation.
2. Check if you have Java Path set in your environment variables otherwise you will need to prove this path every time you compile (Java installation instructions and how to check it)
3. You need to be more careful with spelling Grphics != Graphics

1. If teach yourself java in 21 days telling you to save things in installation of Java throw in the bin. If it was your idea smack your self on hand. Do not mess with installation.
2. Check if you have Java Path set in your environment variables otherwise you will need to prove this path every time you compile (Java installation instructions and how to check it)
3. You need to be more careful with spelling Grphics != Graphics

yes i have make typo error. first,to compile the code,i need to set path the compiler. thats i have learnt juz now, but for applet i still dont have an idea.thats y i post this thread so that sumone could tell and discuss with me what i need to have so that my code can be run.
what is the rules to run Java Applet.i can run using the programming tool but i still dont know how its run and what makes it run.

if i want to run this code,what do i need to do?

import java.awt.Graphics;

class HelloWorldApplet extends java.applet.Applet
{
	public void paint(Graphics g)
	{
		g.drawString("Hello World!!!",5,25);
	}
}

:'(

Editted

Dunno how old is that book but you better have look at this Applets tutorial

book originates with Java 1.1 I think, but may have had superficial updates over the last decade or so (like changing a few version numbers).

Hi all,
i want to ask u guys what else i need to do to run this code?
i have JDK. i have these file in my c:/program files/java/jdk1.6.0_16
c:/program files/java/jdk1.6.0_18 c:/program files/java/jre6.


if i want to run this code,what do i need to do?

import java.awt.graphics;

class HelloWorldApplet extends java.applet.Applet
{
	public void paint(Grphics g)
	{
		g.drawingString("Hello World!!!",5,25);
	}
}

do i need to save the helloworld file inside c:/program files/java ?

im a new leaner...im reading a book teach yourself java in 21 days.but a bit conufse about the compiler or interpreter...

:'(

we have to save it "bin" directory of JDK.and run it using AppletViewer

commented: You do not mess with Java installation, NEVER! -2

oh boy...

I'm pretty sure even an idiot book like yours doesn't tell you to do that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.