Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: First Java Applet

  1. #1
    Junior Member
    Join Date
    Jun 2014
    Thanked 0 Times in 0 Posts

    Default First Java Applet

    Hello everyone,

    As I am a Java Beginner, I am practicing a couple of different things. I've starting by doing a simple game program (Side scrolling). It's not finished yet, but I wanted to put it online, so I gave a look at the JApplet thing.

    And I'm really confused. I'm doing it on localhost, and when I do a simple Hello World program, everything goes smooth : i just put the index.html and my Test.class (the class with the Hello World) and when I go on my localhost it works just fine.
    My question is as follow : How does it work when I have mutiple clases and sprites/images ? basically, my program has 3 folders : "bin", "src" (with my code) and "sprites" (with my images). Are all these things supposed to be where my index.html is ? in my index.html document, is it sufficient to just put the code <applet code="Frame"></applet> with Frame being the class where my main class is ?

    I hope what I'm saying is clear enought. I'm really new to this so thanks you all for your patience.

    Any help will be welcomed !

    PS: I am programming under Ubuntu and using Eclipse. My "Game" works just fine under Eclipse, it's just when I try to use the Applet on my localhost that my browser crashes

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,710 Times in 2,660 Posts

    Default Re: First Java Applet

    I have mutiple clases and sprites/images
    One solution is to put all the resources in a jar file and use the <applet tag's archive= attribute.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    So. Maryland, USA
    My Mood
    Thanked 698 Times in 680 Posts

    Default Re: First Java Applet

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

Similar Threads

  1. java applet
    By tuks in forum What's Wrong With My Code?
    Replies: 8
    Last Post: February 25th, 2014, 10:07 AM
  2. Running a java applet inside a java window?
    By frozen java in forum Java Theory & Questions
    Replies: 3
    Last Post: July 3rd, 2012, 10:55 PM
  3. [SOLVED] Java applet
    By ikocijan in forum What's Wrong With My Code?
    Replies: 11
    Last Post: July 3rd, 2012, 02:54 AM
  4. Replies: 29
    Last Post: May 18th, 2012, 02:16 PM
  5. Need help with Java applet
    By Trendle in forum Java Applets
    Replies: 0
    Last Post: May 18th, 2012, 11:30 AM

Tags for this Thread