The Artima Developer Community
Sponsored Link

Java Answers Forum
browser applet in the browser

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
shenyimin

Posts: 1
Nickname: alexsum
Registered: Sep, 2002

browser applet in the browser Posted: Sep 25, 2002 11:25 PM
Reply to this message Reply
Advertisement
i write an applet(exactly, copy the code from TIJ2) and a html file to browse it. i can see the applet when i double click the html file in the Windows Explorer. But when i publish the .class and .html file to my web site, and ask the URL like this "http://127.0.0.1/applet1.html", the browser just tell me "loading the applet1d class". Anybody give me a hand? Thanks.

I write the html file with tags <applet>...</applet> and use htmlconverter.exe to convert it to <object>...</object> tags.

My environment is:
windows 2000 server
ie6
j2sdk_1.4.0_02

Applet1.html:
<html><head><title>A pplet1</title></head><hr>
<!--"CONVERTED_APPLET"-->
< !-- HTML CONVERTER -->
<OBJECT
classid="clsid:CAFEEFAC-0014-0000-0002-ABCDEFFEDCBA"
WIDTH = 200 HEIGHT = 100
codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0_02-win.cab# Version=1,4,0,20">
<PARAM NAME = CODE VALUE = Applet1d.class >
<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4.0_02">
<PARAM NAME="scriptable" VALUE="false">
<COMMENT>
<EMBED
type="application/x-java-applet;jpi-version=1.4.0_02"
CODE = Applet1d.class
WIDTH = 200
HEIGHT = 100
scriptable=false
pluginspage="http://java.sun.com/products/plugin/index.html#download">
<NOEMBED>
</NOEMBED>
</EMBED>
</COMMENT>
</OBJECT>
<!--
<APPLET CODE = Applet1d.class WIDTH = 200 HEIGHT = 100>
</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->
<hr>&l t;/body></html>



Applet1d.java:
//: c13:Applet1d.java
// From 'Thinking in Java, 2nd ed.' by Bruce Eckel
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
// Console runs applets from the command line.
// <applet code=Applet1d width=100 height=50>
// </applet>
import javax.swing.*;
import java.awt.*;
import com.sym.simple.*;

public class Applet1d extends JApplet {
public void init() {
getContentPane().add(new JLabel("Applet!"));
}
public static void main(String[] args) {
Console.run(new Applet1d(), 100, 50);
}
} ///:~

Topic: Why am I getting error with program that works? Previous Topic   Next Topic Topic: Calculator a Big Problem

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use