Applet can not run in browser, but it wroks in appetviewer. Why?
I wrote a very simple applet, and it works well when I use appletviewer. But when I use browser to open the html file which contains the applet, it always gives no class found error. My browsers are IE5.0 and Netscape4.77. Hwo can I make the applet run in browser?
Quick response is greatly appreciated.
see you have to put the proper code base in your html file.check if your browser is java enabled or not.Java plugin comes with IE 5 and it automatically get installed if you won't disagree with that.Check in optin menu of ur browser that java is enabled or not.
Applet works fine with all browser.
2nd thing when you r running applet through appletviewer,it runs as an application from your local JVM while running through browser means you are running applet through browser 's JVM.
Similar Messages
-
Applet can not run without JRE
I have compiled the applet with J2SE 1.4.0. When I tested on the browser IE 5.0 in my computer, it could run because there is JRE included by J2SE 1.4.0 in my computer. When I tested in other computers, it can not run.the display only gray rectangle and there was a statement x.class is not found in bottom bar.The browser IE 5.0 is java enable. But when I access the webpage that include java application in the same computer without JRE, that could run.
what wrong?
thanksIt is likely that the applet you compiled is using bytecode or features that the other machines don't recognize/have. If the other machines have the MS Java virtual machine but don't have the Sun virtual machine, try compiling the applet with the compiler option "-target 1.1" and see if that helps. It may, unless you used Java features that don't exist in Java 1.1 (for instance Swing classes). If so, then the other machines won't be able to run the applet unless they have the Sun jvm installed (like your machine).
-
Applet does not run in Browser
Iam using Windows XP and IE 6.0. Applets do not run in my browser. Hovering the cursor where the applet should be in the browser, I get a Class not found message. Setting the CLASSPATH variable did not help. Any suggestions?
You might find an answer in this new page
[url http://java.sun.com/j2se/1.4.2/docs/guide/deployment/deployment-guide/upgrade-guide/index.html]Java Upgrade Guide: Migrating From the Microsoft JVM to the Sun JRE -
Applet was not running in Browser
I have wriiten one applet (using JMF for playing a song)program and it was run in appletviewer it's work perfectly.After that i was open this prog in browser it doen't work ,it gives following error :
java.lang.NoClassDefFoundError: javax/media/ControllerListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NoClassDefFoundError: javax/media/ControllerListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)Any one help me,becaz past 4 days i have getting this error ,so i cann't move further any steps on my module ,so any one help me.
Advance Thankx & Regards
K.sureshHai Manu
I am using u r code,and change my applet tag like
<APPLET CODE="SimplePlayerApplet.class" WIDTH = "300" HEIGHT = "300" ></XMP>
<PARAM NAME ="FILE" VALUE = "artist - Track 01.mp3" >
</APPLET>Now i am getting error as:
APPLET tag missing CODE parameter.
java.lang.NullPointerException: name
at sun.applet.AppletClassLoader.getResourceAsStream(Unknown Source)
at sun.applet.AppletPanel$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
the applet program below there
import java.applet.Applet;
import java.awt.*;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import javax.media.*;
public class SimplePlayerApplet extends Applet
implements ControllerListener
public SimplePlayerApplet()
player = null;
visualComponent = null;
controlComponent = null;
progressBar = null;
firstTime = true;
CachingSize = 0L;
panel = null;
controlPanelHeight = 0;
videoWidth = 0;
videoHeight = 0;
System.out.println("Hai");
public void init()
setLayout(null);
setBackground(Color.white);
panel = new Panel();
panel.setLayout(null);
add(panel);
panel.setBounds(0, 0, 320, 240);
String s = null;
MediaLocator medialocator = null;
Object obj = null;
System.out.println("IT's from Init");
System.out.println("S value is:" + s);
if ((s = getParameter("FILE")) == null)
System.out.println("S value is:NULL");
Fatal("Invalid media file parameter");
try
URL url = new URL(getDocumentBase(), s);
System.out.println("URL Value is:" + url);
s = url.toExternalForm();
catch(MalformedURLException malformedurlexception) { }
try
if((medialocator = new MediaLocator("file:" + s)) == null)
Fatal("Can't build URL for " + s);
System.out.println("catch in malformed");
try
player = Manager.createPlayer(medialocator);
System.out.println("it is from create player");
catch(NoPlayerException noplayerexception)
System.out.println(noplayerexception);
Fatal("Could not create player for " + medialocator);
player.addControllerListener(this);
System.out.println("player add control");
catch(MalformedURLException malformedurlexception1)
Fatal("Invalid media file URL!");
catch(IOException ioexception)
Fatal("IO exception creating player for " + medialocator);
public void start()
if(player != null)
player.start();
System.out.println("This from start");
public void stop()
if(player != null)
System.out.println("This from stop");
player.stop();
player.deallocate();
public void destroy()
player.close();
System.out.println("This from Destory");
public synchronized void controllerUpdate(ControllerEvent controllerevent)
System.out.println("This from cotrollerUpdate");
if(player == null)
return;
if(controllerevent instanceof RealizeCompleteEvent)
if(progressBar != null)
panel.remove(progressBar);
progressBar = null;
int i = 320;
int j = 0;
if(controlComponent == null && (controlComponent = player.getControlPanelComponent()) != null)
controlPanelHeight = controlComponent.getPreferredSize().height;
panel.add(controlComponent);
j += controlPanelHeight;
if(visualComponent == null && (visualComponent = player.getVisualComponent()) != null)
panel.add(visualComponent);
Dimension dimension = visualComponent.getPreferredSize();
videoWidth = dimension.width;
videoHeight = dimension.height;
i = videoWidth;
j += videoHeight;
visualComponent.setBounds(0, 0, videoWidth, videoHeight);
panel.setBounds(0, 0, i, j);
if(controlComponent != null)
controlComponent.setBounds(0, videoHeight, i, controlPanelHeight);
controlComponent.invalidate();
} else
if(controllerevent instanceof CachingControlEvent)
if(player.getState() > 200)
return;
CachingControlEvent cachingcontrolevent = (CachingControlEvent)controllerevent;
CachingControl cachingcontrol = cachingcontrolevent.getCachingControl();
if(progressBar == null && (progressBar = cachingcontrol.getControlComponent()) != null)
panel.add(progressBar);
panel.setSize(progressBar.getPreferredSize());
validate();
} else
if(controllerevent instanceof EndOfMediaEvent)
player.setMediaTime(new Time(0L));
player.start();
} else
if(controllerevent instanceof ControllerErrorEvent)
player = null;
Fatal(((ControllerErrorEvent)controllerevent).getMessage());
} else
if(controllerevent instanceof ControllerClosedEvent)
panel.removeAll();
void Fatal(String s)
System.err.println("FATAL ERROR: " + s);
throw new Error(s);
Player player;
Component visualComponent;
Component controlComponent;
Component progressBar;
boolean firstTime;
long CachingSize;
Panel panel;
int controlPanelHeight;
int videoWidth;
int videoHeight;
} -
once i try to see applet using brower it will generate (alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." Your browser is completely ignoring the <APPLET> tag!) Error message
even cant run using appletviewer <class name> on command line
it is posible to run with appletviewer <HTML file name.Html> with (java.security.AccessControlException: access denied (java.net.SocketPermission 130.10.64.62:1001 connect,resolve)) Error message and even it is not functional.
i can compile and run other java appications properly.
i am using windows XP and JRE= C:\Program Files\Java\j2re1.4.2_06
JVM file=C:\WINDOWS\system32\msjava.dll version=5.0.2752.0
can anyone help me to resolve this problem.yes: Thank for help
Still i have the problem to show applets in web browser. it fails the execution of applet tag and show the error message NORMALY alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." Your browser is completely ignoring the <APPLET> tag!
can u please give me a solution for that -
Hello,
I wrote an Applet in JBuilder. I use tag
<applet
archive = "test.jar" >
But it doesn't run in IE, may be JVM was not installed in my PC.
How can I install JVM.
when installing JVM, is it need Windows CD or any files else.Go to http://www.java.com/ and follow the link on the upper right corner to download the JVM. You don't need to have a windows cd at hand.
-
Applet not running in browser?
Hi
What is the reason why an applet will be running in appletviewer but not in a browser???Hi,
Try out with this html file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>Example</title>
<script language="JavaScript">
function MyToolBar()
window.open("Login.html","LoginPage","toolbar=0,menubar=0,scrollbar=0,resizable=0,directories=0,width='110%',height='150%'");
</script>
</head>
<body>
<blockquote>
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.1 -->
<SCRIPT LANGUAGE="JavaScript"><!--
var info = navigator.userAgent; var ns = false;
var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>
<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
var ns = (navigator.appName.indexOf("Netscape") >= 0 && ((info.indexOf("Win") > 0 && info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) | | (info.indexOf("Sun") > 0) | | (_info.indexOf("Linux") > 0)));
//--></SCRIPT></COMMENT>
<SCRIPT LANGUAGE="JavaScript"><!--
if (_ie == true) document.writeln('<Center><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "100%" HEIGHT = "150%" codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Version=1,1,2,0"><NOEMBED><XMP>');
else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.1.2" java_CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
//--></SCRIPT>
<APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" ></XMP>
<PARAM NAME = CODE VALUE = "MyApplet.class" >
</APPLET>
</NOEMBED></EMBED></OBJECT></Center>
<!--
<APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" >
</APPLET>
-->
</body>
</html>
Hope this will help you.
Anil
Developer Technical Support
Sun Microsystems Inc,
http://www.sun.com/developers/support -
I can not run the scanner in my main user, but only the second user and the same thing with updating apps! Why is this happening???
Welcome to the Apple Community.
Enter the details of her second account at system preferences> mail, contacts & calendars. -
Hi, I got the problem with Firefox 27.0.1. I can not run Selenium on Firefox after login a website for automation testing. The browser is not responding. However when I close Nunit, the page is back to be normal. The title is returned to the name of website without "not responding". I sure this problem did not happen on Firefox version 26. I just got this problem when firefox upgrading automatically to version 27. Please help me fix this problem because it is very important for my work. If you need more information pls send your concerns via my email address.
Thanks so muchHi, the work around suggested above should put you in working mode in the meantime. However to help investigate the issue it is possible to analyze what is not loading or taking a long time by analyzing the network traffic or http headers of the Nunit web page.
*[https://addons.mozilla.org/en-us/firefox/addon/live-http-headers/]
*Web developer Tools > Web console
If you post the results with out the user data, we are happy to help. -
i have a mac osx version 10.6.8 no windows installed and i am trying to install a program but keep getting can not run in dos mode ( the disk says on back works on intel mac with parallels or vm fusion) is this program not compatible with my mac?
You run Windows in Parallels or Fusion. Then in Windows you install the program.
-
The problem is this: the last time i ran the windows, but he hangs and died (can not run further the logo). now i can not load not windows, not maс! how to be, what to do???
can any body help me, plz!!
-
My Ipod Shuffle requires Itunes 10 but with my Mac OS 10.4.11 I can not run itunes 10. Is there another way to load this ipod shuffle without updating to Snow Leapord?
Sorry Glen, but there is not. And you don't have to upgrade to 10.6 (Snow Leopard). You need at a minimum of 10.5.8 (Leopard).
B-rock -
Upgraded to lion but now can not run parallel desktop.
upgraded to lion but now can not run parallel desktop. The message show can not load parallel drivers.
Anyone can solve it?Do you have Parallels Desktop 6? That is the version you need to have it run under Lion.
-
The message: "Severe Error; Can 't load resourse file; can not run" appears after closing Firefox4. All other applications on my pc do not have this problem.
I've found text of this error in npdjvu.dll plugin, remove it and error seems to disappear.
-
Flash not running in FF but runs in IE and Chrome
Hello:
I am having an issue with Flash not running in Firefox but it is running in IE and Chrome. The main url is http://www.mcafee.com/us/campaign/network-security/virtualized-data-center.html on which there is a section called "ROI Calculator". The download button links to a flash program which opens up
in IE and Chrome but does not open in Firefox. I am using windows 7 professional and Firefox 8. Here is the code for the page http://www.mcafee.com/us/resources/roi/brocade-mcafee-tco/roi-brocade-mcafee-tco.html :
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<!--
Smart developers always View Source.
This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.
Learn more about Flex at http://flex.org
// -->
<head>
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
function openAddThisWindow(v1,v2,url)
return addthis_open(this, 'email' );
</script>
<!-- BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" />
<!-- END Browser History required section -->
<title></title>
<script src="AC_OETags.js" language="javascript"></script>
<!-- BEGIN Browser History required section -->
<script src="history/history.js" language="javascript"></script>
<!-- END Browser History required section -->
<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;
// -->
</script>
</head>
<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"" ,
"width", "100%",
"height", "100%",
"align", "middle",
"id", "Brocade_ROI",
"quality", "high",
"bgcolor", "#FFFFFF",
"name", "Brocade_ROI",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "Brocade_ROI",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "Brocade_ROI",
"quality", "high",
"bgcolor", "#FFFFFF",
"name", "Brocade_ROI",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
// -->
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="Brocade_ROI" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="Brocade_ROI.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="Brocade_ROI.swf" quality="high" bgcolor="#869ca7" width="100%" height="100%" name="Brocade_ROI" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type"application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed>
</object>
</noscript>
<!-- SiteCatalyst code version: H.21. -->
<script language="javascript" type="text/javascript" src="http://www.mcafee.com/common/js/s_code-20110804.js"></script>
<script language="javascript" type="text/javascript">
s.pageName="corp:en-us:direct:resources:roi:brocade_mcafee_tco";
s.pageName=s.pageName.toLowerCase();
s.channel="corp:en-us:direct:resources:roi";
s.eVar21=s.channel=s.channel.toLowerCase();
s.eVar22="corp:en-us:direct:resources:roi:brocade_mcafee_tco";
s.prop1=s.eVar22=s.eVar22.toLowerCase();
s.events="event1";
s.prop4=s.eVar4="us";
s.prop5=s.eVar5="en-us";
s.prop7=s.eVar7="NA";
s.prop6=s.eVar6="direct";
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code=s.t();if(s_code)document.write(s_code)</script>
<!-- End SiteCatalyst code version: H.21. -->
</body>
</html>
Thanks in advance for your help.Too much text :/ I hate generated source - something always goes wrong and you never know what the hell
What about embedding it yourself?
Create empty HTML file, download swfobject.js: http://code.google.com/p/swfobject/downloads/list
And use this block of code. Of course, change name of swf file, width and height. Unpack swfobject.js right next to the html file.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>SWFObject dynamic embed - step 3</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("myContent.swf", "myContent", "800", "600", "9.0.0");
</script>
</head>
<body>
<div id="myContent">
<p>Alternative content</p>
</div>
</body>
</html>
Maybe you are looking for
-
I am using the Google Maps API, it return in utf-8, so for some countries, caracters are wrong, My server is ISO-8859-1 So, how to convert the result from utf-8 to iso-8859-1 ? I tried : <cfprocessingdirective pageEncoding="UTF-8"> <cfcontent type="t
-
Adobe Captivate 4 Playbar on a Question Slide
I have a project created in Captivate 4 with two question slides. When I preview them, the playbar shows on these slides. Please let me know why the playbar is showing and how to turn it off. Thank you, David Gambal
-
Flash 9 and Firefox on 10.4.7; firefox doesn't detect the plugin.
Yea, Hi. Can anyone help me with finding out why Firefox will not display flash; firefox keeps syaing that the plugin needs to be downloaded, but I already updated to FLASH 9 a few weeks ago. And Safari plays FLASH fine. Anyway, when i was on a page
-
Barcode printing with barcode.dll
Hi, When I am trying to print barcodes, at the end of barcode it prints the control character sequence which is their in suffix control of barcode. Could you please tell me what needs to be changed. Thanks and regards, Anoop
-
Language Dependent Text datasource
I have a language dependent generic text datasource mapped to my language dependent infoobject in BW. In my source system, I have 68 records; 34 English and 34 French. I am only pulling 34 English records to BW but not the 34 French records. In my