Hi, this is my 1st post here - I'm
very new to programming, so this is probably really simple for most of you but hey, we're all beginners at 1st!
* jdk1.6.0_07 - i think
* jre-windows-i586
* crimson editor for the source files
* win xp home sp3
* anything else?
The beginners book I've started learning from gives the following code as the 1st
applet. It compiles ok & runs in the browser, but "Hello from an applet!" appears on a white background, same as the rest of the window, instead of on a grey background as the book says it will.
This is exactly as its given in the book:
import java.applet.Applet;
import java.awt.Graphics;
public class HelloApp extends Applet
{
public void paint(Graphics g)
{
g.drawString("Hello from an applet!", 50, 20);
}
}
& this is the html code given to run it in a browser:
<html>
<head>
<title> The first applet </title>
</head>
<body>
Here comes my first applet:
<br>
<applet code= "HelloApp.class" width=200 height=50>
</applet>
</body>
</html>
Can anyone see what the problem might be? I've done it exactly as given in the book - I suppose the book could be wrong, but it seems more likely that
i'm missing something. It's not that important, but it's niggling (bugging) me .
Anyway, this is also a way of "introducing myself" on the forum. Hi all!
Thanks, Jeff