Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Navin Gada   on Mar 02 In Java Category.

  
Question Answered By: Logan Bouchard   on Mar 02

To test it from browser, create an html file, let's say applet.htm

<html>
<body>
<applet code="FirstApplet.class" width=200 height=100> </applet>
</body>
</html>

Make sure this applet.htm saved in the folder where FirstApplet.class
is located.

For your next lesson, try this one to display the hello world... 8)

File: Hello.java
public class  Hello extends java.applet.Applet {
public void paint(java.awt.Graphics g) {
g.drawString("Hello World!",50,50);
}
}

Html file: hworld.htm
<html>
<body>
This will display the Hello World from java  applet <br>
<applet code="Hello.class" width 200 height = 100> </applet>
</body>
</html>

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on starting to learn java Or get search suggestion and latest updates.


Tagged: