Results 1 to 4 of 4

Thread: applet in jsp?

  1. #1
    Join Date
    Aug 2009
    Posts
    10

    applet in jsp?

    Hi,

    How to have an applet in jsp?


    Thanks,
    LetsC

  2. #2
    Join Date
    May 2008
    Posts
    44

    Re: applet in jsp?

    Applet in JSP

    Applets are small programs or applications written in java. These applets are those small programs that runs on web browsers, usually written in java. We can use the applets in jee also. In jee it runs on the context of web application on a client computer. This applet run in a container, which is provided by a browser or by through a plug- in.

    After making an applet in java we are using the applet class in the jsp by using the html tag <APPLET CODE = "JavaApplet.class" WIDTH = 200 HEIGHT = 150></APPLET>. This is one of the way by which can use an applet in jsp.

    Code:
    import java.applet.*;
    import java.awt.*;
    
    public class javaApplet extends Applet{
      public void paint(Graphics g){
        g.drawString("Welcome in Java Applet.",40,20);
      }
    }
    HTML code:

    Code:
    <HTML>
    <HEAD><title>Applet In Jsp</title>
    </HEAD>
    <BODY>
    <APPLET ALIGN="CENTER" CODE="javaApplet.class" WIDTH="800" HEIGHT="500">
    </APPLET>
    </BODY>
    </HTML>

  3. #3
    Join Date
    May 2008
    Posts
    41

    Re: applet in jsp?

    Applet in JSP

    The jsp:plugin tag will generate the right html code to load your Applet.

    <jsp:plugin type="applet"
    code="TestApplet.class"
    width="500"
    height="300">

    <jsp:params>
    <jsp:param name="message" value="Hello, world"/>
    <jsp:param name="action" value="<%=AppletAction%>"/>
    </jsp:params>

    <jsp:fallback>
    <p> unable to start plugin </p>
    </jsp:fallback>
    </jsp:plugin>

  4. #4
    Join Date
    Feb 2009
    Posts
    96

    Re: applet in jsp?

    you have to declare a html tag in its own file. Let's say you make your applet and want to see how it works. You then have to make a html file that calls the applet to work.

Similar Threads

  1. Load an Applet from a Jar
    By TechGate in forum Software Development
    Replies: 5
    Last Post: 25-02-2010, 02:31 AM
  2. How to Deploy an Applet?
    By MarceloQuad in forum Software Development
    Replies: 4
    Last Post: 18-02-2010, 03:47 AM
  3. Signed Applet Verification
    By technika in forum Software Development
    Replies: 5
    Last Post: 08-02-2010, 09:46 PM
  4. Java applet errors
    By Harpreet Gaur in forum Software Development
    Replies: 5
    Last Post: 12-01-2010, 12:08 PM
  5. How to run an Applet Program
    By sarafsneh in forum Software Development
    Replies: 1
    Last Post: 04-01-2010, 06:07 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,314,034.15851 seconds with 17 queries