keko4201
01-06-2005, 08:24 PM
hey guys hows it goin, finished with school now, and on my own i am learning applets. um now this might be a stupid question , but this isnt working for me, not sure whats up. how do i save a java text as a class file. cause im using this code and in the utorial, they show the target using a class file, not a .java file. not sure if it make a difference or not, so i used the file that it saved as(.Java).
can someone help
/////////////////////////////////////////////////////////////////////
java file
/////////////////////////////////////////////////////////////////////
import java.applet.Applet;
import java.awt.Graphics;
public class HelloWorld extends Applet {
public void paint(Graphics g) {
g.drawString("Hello world!", 50, 25);
}
}
with this html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<applet code="file:///C:/Documents and Settings/Me/Desktop/Web/HTML Development/Java/Class'/test.java" WIDTH="150" HEIGHT="25">
</applet>
</body>
</html>
but htis does not work, just gives me a grey box wit the target directory. any suggestions?
can someone help
/////////////////////////////////////////////////////////////////////
java file
/////////////////////////////////////////////////////////////////////
import java.applet.Applet;
import java.awt.Graphics;
public class HelloWorld extends Applet {
public void paint(Graphics g) {
g.drawString("Hello world!", 50, 25);
}
}
with this html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<applet code="file:///C:/Documents and Settings/Me/Desktop/Web/HTML Development/Java/Class'/test.java" WIDTH="150" HEIGHT="25">
</applet>
</body>
</html>
but htis does not work, just gives me a grey box wit the target directory. any suggestions?