How to convert a Java Application to Java Applet for the web?

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to convert a Java Application to Java Applet for the web?

  1. #1
    Join Date
    Aug 2010

    How to convert a Java Application to Java Applet for the web?

    So far I've been successful at creating a simple applet using this Java code:

    import java.awt.Graphics;
    public class HelloWorld extends java.applet.Applet {
        public void init() {
        public void paint(Graphics g) {
    	g.drawString("Hello world!", 50, 25);
    I uploaded the class file into my web host's file manager and ran it using this HTML code, and it works perfectly:
    <applet code="HelloWorld.class" width=600 height=500>

    All it does is print "Hello world" in black font on a white background.

    ...But now I'm trying to take a much more complicated Java application and transform it into an easy to use Java applet for the web and I can't figure out why the browser comes up with nothing more than an empty applet window that says error.

    The application I'm trying to turn into an applet is in the attached word document. It's the start of a car racing game that runs perfectly in the NetBeans IDE. If anyone can point me in the right direction on this please let me know. Thanks in advance.
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2005
    SW MO, USA
    Look in the browser's java console and copy and paste the error message from there if you need help understanding the error message.

    Please either attach your code in a zip file or post it in the forum.

Similar Threads

  1. Replies: 0
    Last Post: 01-24-2010, 03:38 PM
  2. Replies: 0
    Last Post: 01-03-2010, 07:58 PM
  3. Replies: 0
    Last Post: 09-26-2008, 12:56 AM
  4. Replies: 0
    Last Post: 06-29-2006, 12:06 PM
  5. Replies: 1
    Last Post: 07-24-2000, 03:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center