simple java applet help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: simple java applet help

  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Unhappy simple java applet help

    im following the java tutorial at their web site online. I'm having problems with these simple applets:
    http://java.sun.com/docs/books/tutor...MeApplets.html
    I compiled them fine on my other computer, but when I compiled them on the computer I am using presently, I get a problem.

    the files seem to compile fine. but when i compare them with the files online, my files that i compiled are a little less in size. when i load the applet in the provided html file, all i get is a blank gray screen. and when i move the mouse over the gray screen, it says for a split second: "load: class ClickMe not found"
    i have all the correct files...but after compiling the .java files, it doesn't work. the .class files on the web work fine. but my compiled files seem to be smaller than those on the web.

    the ClickMe.class file i compiled is 1.45 KB (1,494 bytes)
    the Spot.class file i compiled is 293 bytes (293 bytes)

    the ClickMe.class file online is 1.50 KB (1,539 bytes)
    the Spot.class file online is 339 bytes (339 bytes)

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    I beleive this size difference is caused by different compiler settings.
    But that isn't the problem. Here is an example html snippet that is part of a code I use for a 'do-it-all' applet I have as a hobby project. The package i compile my classfiles into is called 'site' and this is the stucture on my server:

    public_html->site

    this code resides in a page in the public_html directory. My class files reside in the site directory:

    Code:
    <applet
      codebase = "."
      code     = "site.SiteApplet.class"
      name     = "theApplet"
      width    = "180"
      height   = "900"
      hspace   = "0"
      vspace   = "0"
      align    = "top"
    >
    Please have a look

    Click the 'java-dev' link.
    eschew obfuscation

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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