blackbirdMIT
IS-IT--Management
I have these files:
AnotherHello.class
AnotherHello.html
AnotherHello.java
Applet Code:
import java.applet.Applet;
import java.awt.*;
public class AnotherHello extends Applet
{
public void paint ( Graphics gr )
{
setBackground( Color.lightGray );
gr.drawString("Hello", (300/2 - 40/2), (150/2 + 10/2) );
}
}
HTML Code:
<html>
<body>
<applet code="AnotherHello.class" width="300" height="150">
</applet>
</body>
</html>
I did this:
C:\> appletviewer AnotherHello.html
BUT, it still didn't show me the applet with the Hello string. System would hung when using the appletviewer.
I also tried to open the html file using the internet explorer browser. All I get is the gray box but without the Hello String.
WHAT AM I MISSING?
AnotherHello.class
AnotherHello.html
AnotherHello.java
Applet Code:
import java.applet.Applet;
import java.awt.*;
public class AnotherHello extends Applet
{
public void paint ( Graphics gr )
{
setBackground( Color.lightGray );
gr.drawString("Hello", (300/2 - 40/2), (150/2 + 10/2) );
}
}
HTML Code:
<html>
<body>
<applet code="AnotherHello.class" width="300" height="150">
</applet>
</body>
</html>
I did this:
C:\> appletviewer AnotherHello.html
BUT, it still didn't show me the applet with the Hello string. System would hung when using the appletviewer.
I also tried to open the html file using the internet explorer browser. All I get is the gray box but without the Hello String.
WHAT AM I MISSING?