when the class extends JApplet then whether that class can be called by <applet> tag of HTML ? I tried but failed ? Please solve it.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   shailendra_kanth
Posted On:   Monday, April 2, 2001 03:11 AM

Although I am able to call by appletviewer but not from html tag.My browser is fully java enabled.I am able to call the classes which extends Applet instead of JApplet. Here is the applet: import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.net.*; /* */ public class searchItem1 extends JApplet { JTabbedPane jtp; public void init() { jtp=new JTabbedPane(); jtp.add("softwareItems",new SoftItemPanel()); getContentPane().add(jtp); } } class SoftItemPanel extends JPanel implements ItemListener { public SoftItemPanel() {    More>>

Although I am able to call by appletviewer but not from html tag.My browser is fully java enabled.I am able to call the classes which extends Applet instead of JApplet.

Here is the applet:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;

/*
*/

public class searchItem1 extends JApplet
{
JTabbedPane jtp;
public void init()
{
jtp=new JTabbedPane();
jtp.add("softwareItems",new SoftItemPanel());
getContentPane().add(jtp);
}
}
class SoftItemPanel extends JPanel implements ItemListener
{
public SoftItemPanel()
{
JComboBox jcb=new JComboBox();
jcb.addItem("systemType");
jcb.addItem("applicationType");
jcb.addItem("operatingSystem");
jcb.addItem("dataBase");
jcb.addItem("ecommerce");
jcb.addItem("middleware");
jcb.addItem("utilities");
jcb.addItem("distributedApplication");
add(jcb);
jcb.addItemListener(this);
}
public void itemStateChanged(ItemEvent ie)
{
String s=(String)ie.getItem();
System.out.println("u have selected "+s);
}
}

And I call by following html which is in the same directory :






   <<Less

Re: when the class extends JApplet then whether that class can be called by &lt;applet&gt; tag of HTML ? I tried but failed ? Please solve it.

Posted By:   John_Zukowski  
Posted On:   Tuesday, April 3, 2001 10:02 PM

Read the FAQ
About | Sitemap | Contact