Thread: How to start
View Single Post
  #2 (permalink)  
Old 08-06-2007, 09:43 AM
cruxblack cruxblack is offline
Senior Member
 
Join Date: Jul 2007
Posts: 130
cruxblack will become famous soon enough
1. import the package javax.swing.* and java.awt.*
2. extends the JApplet class or Applet class in the class u want to make Applet
3. override the
- public void init(), this acts like the public static void main(String[] args)
- public void start(), optional, read tutorials bout multithreading for details
- public void paint(Graphics g), this manages the drawing of ur applet
4. create a html file consisting a tag applet, at the very least like this
Code:
<html> <applet code="something.class" width=300 height=300> </applet> </html>
5. compile ur .java source code and use a browser to run the applet, or u can also use the appletviewer command from the command prompt
And thats the brief outline of making an applet
For further details u can just look at the sun tutorial or look in the Java Applets thread in this forum, lotsa examples there
Reply With Quote