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: Embed applet in webpage

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Thanked 0 Times in 0 Posts

    Post Embed applet in webpage

    I just learned how to program Java. I created Applets as part of an online class. I asked the instructor how to share the applets I created with my friends, and he told me I'd have to pay for another class before he would tell me. Not happy with that response I tried to figure it out on my own.

    What I can't figure out is how to embed my applets which I wrote in the code
    g.drawString("Click on the screen", ((getWidth()/2))-50, getHeight()/2);

    As I wrote this I envisioned the code as being flexible since web browsers are flexible, but apparently they aren't when dealing with applets.

    The only thing I know about applets is to put this in html:

    <applet code=AppletClassName.class
            width=320 height=240>

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

    Default Re: How to get screen size in Applet

    Do you get errors? Please copy and paste them here.

    I don't know if applets can get information about the computer they are running on.

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Thanked 833 Times in 772 Posts
    Blog Entries

    Default Re: Embed applet in webpage

    Please do not hijack someone else's thread (especially one that is over a year old). I have moved your post to a new thread.

Similar Threads

  1. How would you use HTML to embed a Java applet within it?
    By javapenguin in forum Java Theory & Questions
    Replies: 1
    Last Post: May 5th, 2011, 05:16 AM
  2. Login form on webpage
    By rosebabz in forum JDBC & Databases
    Replies: 0
    Last Post: January 14th, 2010, 10:34 AM
  3. [SOLVED] Need to display multiple images from database on a webpage
    By raghuprasad in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: May 13th, 2009, 03:15 AM
  4. Updation of webpage to the last modified date
    By Revathy G in forum Java Programming Tutorials
    Replies: 1
    Last Post: May 6th, 2009, 04:47 AM
  5. Updation of webpage to the last modified date
    By Revathy G in forum Java Code Snippets and Tutorials
    Replies: 1
    Last Post: May 6th, 2009, 04:47 AM