The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.34 / 5.00 31,296 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 10,082 ViewsAny one know how to make this an applet.
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
/*
// header - edit "Data/yourJavaAppletHeader" to customize
// contents - edit "EventHandlers/Java Applet/onCreate" to customize
*/
public class BowlingApp extends java.applet.Applet
// declare variables
String sgame;
int game1,game2,game3;
int avg;
BufferedReader dataIn =new BufferedReader(new InputStreamReader(System.in));
System.out.print("Please enter the first game's score: ");
sgame = dataIn.readLine();
game1 = Integer.parseInt(sgame);
System.out.print("Please enter the second game's score: ");
sgame = dataIn.readLine();
game2 = Integer.parseInt(sgame);
System.out.print("Please enter the third game's score: ");
sgame = dataIn.readLine();
game3 = Integer.parseInt(sgame);
avg = (game1 + game2 + game3)/3;
System.out.println("Your average score is " + avg);
Image logo; //declares an Image a object
public void init()
{
resize(300,300);
}
public void paint(Graphics g)
{
g.drawString("Hello BowlingApp!", 50, 50);
}
}
Is there an option to compile as an applet? There should be.
javac.exe (filename)
and embed the .class file in a website, or use the applet viewer in the java 1.4.2 sdk
there is no difference between two class files in java, an application is "identical" with an applet. The only difference is the defintion of "entry point", an application is being run by an external application (jvm), through a known entry point (public static void main(String args[])) while an applet is initiated throught the abstract function in the Applet class called void init(), and repainted by an abstract function in the same class.
"no sound in ass"
I'm tring to get this dumb ##$# thing as an applet
You need a "{" after the class name (declaration? I don't know what it's called :p).
Never mind I misunderstood the information. I hate java