
Originally posted by Angela Jessi:
Hi all,
This following is very simple code:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class TLabel extends JApplet{
public void init()
{
Container contentPane = getContentPane();
JLabel label = new JLabel("This is Swing Applet",JLabel.CENTER);
contentPane.add(label);
}
}
No problem in compilation? But I can't see anything when i run in Browser.When I have windows 98, it was running.Now I have windows 2000,it is not running.So the problem is regarding platform or Browser or in my code or HTML file!!!
I have to use appletviewer(if yes,please give me syntax) or HTML?
Please let me know,
Thanks
Angela
Originally posted by Angela Jessi:
Hi Bodie
I appreciate your response.
I wrote TLabel.HTML and open it in Browser. And I am getting following.
<HTML>
<HEAD>
<TITLE>Key Event JApplet one</TITLE>
<APPLET code="TLabel" HEIGHT=200 WIDTH=200>
</APPLET>
</HEAD>
</HTML>
Please let me know b'coz still I can't see anything in Browser?
Regds
Angela
Brent Worden
Originally posted by Noah Carroll:
Angela,
Like I mentioned before, Java 2 is not supported by the available web browsers(although, netscape 6 will soon). Because this java support is not built into the browser users that want to be able to view Java 2 applets inside their browser must download a Java Runtime Environment that supports Java 2. It is run as an active-x control in microsoft internet explorer and a plug-in in netscape. However, once this is installed it does not auotmatically work with the ordinary applet tag. Internet explorer has an object tag that when used with certain numbers will call the java runtime environment. Unfortunately, netscape does not recognize the object tag, but they do recognize the embed tag(which ie does not support). When a browser finds a tag does not know it simply ignores it, and everything in between. The HTML converter makes up a somewhat complex block of html code that you must use in place of this applet tag. When the browsers find this code they know what to ignore and what to run. Java 2 applets is what they end up running. I hope I didn't confuse you, but it is actually quite an easy thing to accomplish.
The HTML converter can be downloaded at http://java.sun.com/products/plugin/1.3/features.html
"In the country of the blind, the one eyed man is the King"
Gautham Kasinath CV at : http://www.geocities.com/gkasinath
Originally posted by gautham kasinath:
Hi! Well there is no such association with Netscape and IE as far u r code is concerned.. well lemme see. yeah! Applet tag is not recognised by Netscape.. but object is.. well although u have the plug in the code doesnt work.. well I trid running it but it gave me a javax.swing.JApplet classNotFoundException. I dunno why.. but lemme work on it and let u know.. I WILL solve the puzzle for sure..
Please be patient
Regds
Gautham Kasinath
