jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes Embed JApplet in JSP code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Embed JApplet in JSP code" Watch "Embed JApplet in JSP code" New topic

Embed JApplet in JSP code

Rakesh Gadre
Ranch Hand

Joined: Feb 22, 2003
Posts: 47
how to add JApplets in JSP code using jsp lugin tag ?
I have tried that using awt applet, but it does not work with JApplet ?
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
What do you mean by "it does not work"?
Could it be that your browser has too old version of the JRE/Java Plugin?

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Rakesh Gadre
Ranch Hand

Joined: Feb 22, 2003
Posts: 47
My syntax goes like this :
JSP code :
<title> Plugin example </title>
<body bgcolor="white">
<h3> Current time is : </h3>
<jsp lugin type="applet" code="serv.class" jreversion="1.2" width="160" height="150" >
Plugin tag OBJECT or EMBED not supported by browser.
</jsp lugin>
<font color=red>
The above applet is loaded using the Java Plugin from a jsp page using the
plugin tag.
import javax.swing.*;
import java.awt.*;

public class serv extends JApplet
public void init()
JButton b = new JButton(new ImageIcon("42.gif"));
Now, if I comment last two lines from the applet code i.e. if I remove the button part, I get the output on the brtowser. The background colour changes to yellow. But, If i try to add a button, It keeps on diaplaying the grey screen.
I agree. Here's the link: http://aspose.com/file-tools
subject: Embed JApplet in JSP code
It's not a secret anymore!