Please check my java applet
i don't understand why i am able to compile it but not to run it. Here's my code:
import javax.swing.*;
public class ASampleGUIProgram
{
public static void main(String[] args)
{
String appleString;
appleString = JOptionPane.showInputDialog("Enter number of apples:");
int appleCount;
appleCount = Integer.parseInt(appleString);
String orangeString;
orangeString = JOptionPane.showInputDialog("Enter number of oranges:");
int orangeCount;
orangeCount = Integer.parseInt(orangeString);
int totalFruitCount;
totalFruitCount = appleCount + orangeCount;
JOptionPane.showMessageDialog(null, "The total number of fruit = " + totalFruitCount);
System.exit(0);
}
}
and this is the html code:
<html>
<head>
<title>ASampleGUIProgram</title>
</head>
<body>
<center>
<H1 >Applet Title</H1>
<applet code="ASampleGUIProgram.class" width="200" height="200"> </applet>
</center>
</body>
</html>
please check it. thanks!!!