Results 1 to 5 of 5
  1. #1
    MaxHardcastle is offline Member
    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    Default Quick Applet Issue

    Hi,

    I just started using Eclipse, and when I create an application in Java3D it shows up just fine and dandy running as an application, but when I go to run it as an Applet, it shows a grey box. Is that a common issue? How can I fix it...

    I am remembering now that I tried creating an Applet that says "hello world" which also did not work at all (following a tutorial). The code was:

    Java Code:
    import java.applet.*;
    import java.awt.*;
    
    public class HelloWorldApplet extends Applet
    {
       public void paint (Graphics g)
       {
          g.drawString ("Hello World", 25, 50);
       }
    }
    It is from this tutorial: Java Applets Basic Tutorial

    Am I doing something wrong? I am on an Ubuntu machine and I'm using OpenJDK 6 and 7 (both installed... not sure why). Java applets all over the internet work... Facebook, RuneScape, etc.

    Thanks!

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,899
    Rep Power
    25

    Default Re: Quick Applet Issue

    Am I doing something wrong?
    Probably. Are there any messages in the browser's java console? What does the HTML page have in it that calls the applet code? Where is the applet's class file?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Quick Applet Issue

    Please go through the Forum Rules -- particularly the third paragraph.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    MaxHardcastle is offline Member
    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    Default Re: Quick Applet Issue

    Okay, I'm not actually using a browser but rather I'm choosing "Run as Applet" in Eclipse. Should I use an html document to run all my applets? I remember trying that and getting an "iced tea crashed" or something similar. I was using Firefox&Chrome (tried both & got same error). I'm not sure how to check the java console in the browser, but I will go and try the things you mentioned again: Start in browser, check console...

    I'm unsure of what you mean by:
    Where is the applet's class file?
    Do you mean the file that contains java.applet? I have no idea where it is! Maybe I don't have it... that would be an obvious reason as to why it's not working, but I'm not getting any errors when I run it.

    @db: How can I change the post-title? There doesn't seem to be an option... sorry about the confusion.

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,899
    Rep Power
    25

    Default Re: Quick Applet Issue

    I'm unsure of what you mean by:
    When you compile a java file successfully, the compiler creates one or more class files.

    If you are using the IDE: Eclipse, I have no idea where it puts files and how it executes an applet's class file.
    Try asking in the IDE forum:
    Eclipse
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Quick Java Applet Study
    By obrienfk in forum Reviews / Advertising
    Replies: 0
    Last Post: 02-02-2011, 05:05 PM
  2. Quick applet question!!
    By fezman1337 in forum JCreator
    Replies: 1
    Last Post: 12-21-2010, 03:22 AM
  3. Applet Mac issue
    By omdom in forum Java Applets
    Replies: 1
    Last Post: 08-23-2009, 08:54 PM
  4. A Quick Applet Question :)
    By smithywill in forum New To Java
    Replies: 1
    Last Post: 07-15-2009, 02:35 PM
  5. Java Applet Issue
    By bmw4l1f3 in forum New To Java
    Replies: 9
    Last Post: 11-13-2008, 05:39 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
  •