<html>
<head>
<title>Game</title>
</head>
<body>
<applet code="game/Game" name="Game" archive="Game.jar" width="800" height="600">
No java support.
</applet>
</body>
I'm currently trying to run the above html code in a web browser in order to display my java applet game. The html file is in the same directory as the jar file. What happens when I open the html page is that it asks me if I want to trust the applet (which I just digitally signed myself), and when I say yes, it just displays a blank screen. Also, my CPU usage increases noticeably, so I imagine something is getting stuck.
I can run my applet in Eclipse with no problems. Furthermore, I realize the applet tag is deprecated, however I'm not looking to make this too complicated, plus I need it to run on computers with very outdated browsers.
So, what could the reasons be that my applet will not display? I receive no errors/exceptions, it just shows a white area where my applet should be. Also, when I put the mouse over that area, the cursor does change to what it would be if it were over an applet.
EDIT: Interestingly enough, I was clicking around on the white area where the applet should be, and managed to make one of my in applet menu texts come up. I'm thinking that maybe my images are just not showing up. Why might this be the case?
Related
I am using mshtml and internet explorer to automate a website. The website is not publicly available. On a page there is a Java Applet which is contained in a APPLET html tag.
The problem is that sometimes the applet takes a long time to load and without it being loaded other controls on the webpage cause errors. I do not need to automate the applet and the applet has nothing to do with what I want to do other than it causes other problems.
Whilst there might be other things you would like to suggest, I would at this stage like to focus on my main question of trying to find some property or event in the HTML which indicates that the Applet is loaded.
Things I have tried to check;
The HTML document has an Applets property which returns the applet collection. This collection contains the applet.
The Applet has a readystate of 4, its object attribute is also not nothing.
Despite these checks the applet is still not loaded.
Anyone coming here, I am sorry but the answer to this question is that I could not find anything in the DOM (the html page) which indicated if the applet had loaded. I, however, believe that it will really depend on the page you are looking at. I think that due to security issues you cannot access the isActive function of the Applet itself. The best you can hope for is that there might be some other html or javascript on the page which also waits for the applet and then you can wait for this.
Is it possible for a web site that uses either Java or Javascript to accomplish the installation (meaning: not just forced download) of an executable on a client Windows system (Windows 7 or newer) when user clicks on only one link on the website?
So in this scenario, the user clicks on a link (e.g. some click-bait link) that is supposed to display some article or a video, on a website. Can this sole single click lead to both a forced download and actual installation of an executable on the users machine?
I do not need, nor am I looking for, explicit detail on how this is done. I am more curious of whether this is even possible with the current Windows OS. In this case the user would be using a recent version of one of the following browsers: IE, FF, Chrome, or Opera.
You are asking about a drive by downloader?
The answer is yes these in java are called applets. Here is come HTML from a webclient what uses an applet.
<HTML>
<HEAD>
<TITLE>Your Webclient</TITLE>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
<BODY>
<applet name="yourclientname" width="765" height="503" archive="client.jar" code="client.class">
<param name="java_arguments" value="-Xmx1024m">
</applet>
</BODY>
</HTML>
For a hacker to do it all they need to do is change the .jar and .class in the above. And Java will prompt you to ask if you want to run the applet once you click yes it will run java code normally a dropper. Btw most hackers don't install stuff they either sneak into registry or they simply put a copy of their exe or .jar into your startup folder.
You will have a chance to say no as stated above its just an allow or disallow option. The rest of the HTML can be used to load a picture or whatever. Here is what the allow screen looks like,
http://openigloo.org/wp-content/uploads/2011/05/signed-applet.jpg
This question already has answers here:
Java Error: "Your security settings have blocked a local application from running"
(10 answers)
Closed 9 years ago.
I have a Java applet that displays a simple image. I have the following HTML markup to run the applet:
<!DOCTYPE html>
<html>
<head>
<title>Traffic Light Demo</title>
</head>
<body>
<applet code="TrafficApplet.class" width="300" height="400">
</applet>
</body>
</html>
The applet I am trying to run is in the same directory as this HTML file. It was running just fine until last weekend when I updated my JRE to update 21 (I also updated my JDK to the latest version at the same time.
I'm running a 64 bit Windows 7 system.
The problem I'm having is that when I try to run the HTML file I get an error that says:
Application Blocked by Security Settings
Your security settings have blocked a local application from running.`
It was suggested to me that I try the following;
Open Control Panel, select Programs, select Java, select the Security tab, and move the slider to Medium (it defaults to High). I tried that. It had no effect. Also, when I close the Control Panel, try to re-run the HTML file, it fails, then try go back to the security setting, it has gone back to the High setting.
How do I fix this?
Most of the newer HTML5 documents have the
!DOCTYPE html
heading, which the applet tag is now appreciated in HTML5. I am not sure as to how to load an applet, but when I tried an Applet in HTML5, it didn't support it. Also, the update might have caused the newer Java to conflict with whatever coding is in your applet.
I have an html page, where I dynamically create applet's HTML code and insert it into the page with with javascript.
After that I call some applet's methods.
Everything works fine in other OS's, and user to work in some Linux machines before.
But now under Linux I get a very strange and too general error message:
Error calling method on NPObject!
I really don't understand what is going on.
When creating applet code not dynamically (not wit JS, just insert it into HTML in the template), it works fine.
What could this be?
Any thoughts?
Thanks.
What could this be?
The latest in a long line of applet/JS/browser/CSS interaction bugs. Here are the hits for applet liveconnect.
Any thoughts?
Don't fight it, but instead use another strategy. I suggest:
Load the applet at page load.
Hide the applet using CSS (move it off the visible page, or make the size small).
Trigger JS that interacts with the CSS To reveal the applet.
I have applets in my projects. When I want to display applet I load that applet using the applet tag in jsp page and load that page in div tag. it work fine. but when more applets loaded in same browser window then this window is slow down and sometime freezes and applets also becomes unresponsive . when i close the applet the loading div tag still in webpage.
is there any way to communicate betwwen applet and javascript. so that when applet close we are able to remove particular div or set to empty in which applet loaded.
When more applets loaded I check with top command java uses more memory and cpu also.
is there any way to minimise it or communicate between applet and javascript.
Thanks
To communicate with applets, all you need to do is mark methods as as public and call them like so:
<applet code="com.something.MyApplet"
mayscript="true" name="myApplet" width="200" height="100">
Assuming a doSomething method, call it like so from your web page:
myApplet.doSomething("Hello");
As far as the web-page crashing, that's harder to debug, try different embedding methods in different browsers. Try to avoid serving more than one or two applets. Try to figure out if an applet in particular is causing a proble.