Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-08-2009
Member
 
Join Date: Aug 2009
Posts: 10
applet in jsp?

Hi,

How to have an applet in jsp?


Thanks,
LetsC
Reply With Quote
  #2  
Old 08-08-2009
Member
 
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>
Reply With Quote
  #3  
Old 08-08-2009
Member
 
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>
Reply With Quote
  #4  
Old 10-08-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "applet in jsp?"
Thread Thread Starter Forum Replies Last Post
Load an Applet from a Jar TechGate Software Development 5 25-02-2010 02:31 AM
How to Deploy an Applet? MarceloQuad Software Development 4 18-02-2010 03:47 AM
Signed Applet Verification technika Software Development 5 08-02-2010 09:46 PM
Java applet errors Harpreet Gaur Software Development 5 12-01-2010 12:08 PM
How to run an Applet Program sarafsneh Software Development 1 04-01-2010 06:07 PM


All times are GMT +5.5. The time now is 03:18 PM.