applet

Why do applets not need a main()?

This applies to subclasses of Applet, Servlet, Midlet, etc. Why do they not need a main()? If I wanted to create a Craplet class that starts at init() or something similar, is it bad design, or how would I go about doing it? ...

Why some times Java does not request for new versions of jar files?

Every time we update our Java application (Java client and Java server) we have the problems that some clients approx. 1% - 2% does not load the new jar files. This occur with applets and also with Java Web Start. If you clear the Java Cache then all is working correct. Any idea why Java does not check for new jar files on every start? ...

Listing a local directory from a signed applet

The following applet is compiled and packed into jar which is then signed with a self-signed cert. import java.applet.Applet; import java.io.File; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; public class Test extends Applet { private static final...

Obtaining in IE the length of a Java array passed from an applet to its Javascript wrapper

I have the following method in my applet: public File[] getFiles() Which I call from Javascript as follows: var files = applet.getFiles(); for (var i = 0; i < files.length; i++) { // Do something. } This works in Firefox but IE gives me 'length' is null or not an object Any ideas anyone? ...

Changing grails.serverURL has no effect on createLinkTo( [...], absolute:'true')?

I'm trying to display a Java applet in a page on a Grails server. I'm using Sun's handy Javascript snippet for displaying applets: <script src="http://java.com/js/deployJava.js"&gt;&lt;/script&gt; <script> deployJava.runApplet({codeBase:"${createLinkTo(dir:'applet', absolute:'true')}", archive:"${createLinkTo(dir:'com/steve/applet',...

Applet works, but swing components won't appear!

So I am creating this applet which I want to have full on swing components in it. I have looked at all the docs, I have made the applet, and I can get something to show up in it if I override the update(Graphics g) method, but simply adding components to the contentPane doesn't seem to be doing it! What am I doing wrong? import javax....

Signed Java Applet writing to a text file

I want to make an Applet write to a text file. I think have overcome the security problem with my own certificate, but the text file isn't receiving the output. My Applet can be seen at tomrenn.com/fallball, and should ask if you trust the certificate. I'm not sure an Applet can write to a text file within the web hosted contents, so I...

How to deploy a java applet for today's browsers (applet, embed, object)?

How do i deploy a java applet for modern browsers? I know there are somehow 3 possibilities but nobody tells me which one to prefer and how to use them. Does somebody have any resources on that? i cant find any :( ...

Storing files on client\harddrive from browser\java applet

(How) is it possible to let the user store a file (via save file dialog) on the local harddrive via a java applet? Is there any workarounds for this or do I have to apply for some sort of certificate somewhere? For example, when printing from a Java Applet the user gets a dialog asking for permission, is it possible to do something sim...

Open window from applet (Bang! Howdy)

I need to open an external window from a Java applet. How can I do it without making the window a child of the applet? I need the window to stay open even when the applet is closed. I know it can be done. Bang! Howdy does exactly what I'm trying to achieve. http://www.banghowdy.com/launch.html ...

Java applet fails to show &rsquo; randomly

My Java applet fails to show HTML-encoded (&rsquo;) on JTextPanel panel randomly. Is this a JRE-specific bug? It works OK with my test pc but the customer has a problem that encoding is shown on GUI. ...

Download remote jar files and monitor the download progress

I'm new to Java (I come from an ActionScript background) and I'd like to know if there's a way to download and monitor the download progress of remote jar files inside an applet, then use the classes and other resources that are inside the downloaded jar. I know there's a JarURLConnection class, but I could not find a way to monitor the ...

How can I get a signed Java Applet to perform privileged operations when called from unsigned Javascript?

Signed Java Applets have the same security clearance as a normal Java application running on the client. For a particular project, I need these permissions, and I need to perform privileged operations as a result of a JavaScript call. Now, the problem is that, at least for Firefox 3 in Ubuntu (target browser and platform), when an apple...

.class vs .java

What's the difference between a .class file and a .java file? I am trying to get my applet to work but currently I can only run it in Eclipse, I can't yet embed in HTML. Thanks **Edit: How to compile with JVM then? ...

Audio in Java Applet not playing.

Hi, I am trying to play audio in a Java applet but it is not working. What could be the problem? EDIT: Besides the limited number of files that Java can play, the problem was that I didn't realize that the bin folder (in Eclipse workspace) contains the .class file that is run. So my code referring to the getDocumentBase() couldn't find...

What is the Rolls-Royce way to deploy a Java applet?

I know how to deploy an applet using applet, object, embed tags and JavaScript, but I'm after the best approach (in terms of end user experience). Sun suggests using the applet tag, and a mixed embed / object tag on the same page. What I am considering is the following: Cross-browser support. Fallback to download page if incorrect Ja...

Signed applet without modifying policy file manually.

Currently I had developed an applet. Applet basically uses java.awt.Robot package for capturing screen. I want to store captures images locally. I had signed my applet jar. Still when applet tries to write file into local system it gives access error. Is there any way by which I can write file in local file system without modifying polic...

How tomcat is able to locate a class that is not part of any of the jars in app libs

In our application(applet) I want to enable export functionality if one of the required jars is found. I do not want to add this jar applet references to avoid download size. I am using Class.forName with one of the classed to check whether particular is available. In local machine Class.forName call retruns an instance although the jar...

How can I display a bitmap image in a Java applet?

I am having a hard time figuring out how to show an Image (or ImageIcon) in a Java applet. The following is my code. The picture (test.bmp) does exist and is on the D drive but when I run this I get the applet window with nothing in it. Can somebody tell me what I am missing to make the ImageIcon show? public class Form1 extends JAppl...

Is there a way to reload/refresh a java applet from within the applet itself?

I have a button on my applet (contained in a browser) that I would like to make reload or refresh the entire applet one of two ways: Refresh the applet itself without having to refresh the browser Refresh the entire browser Is this possible from within the applet? ...