applet

Java Applet Permissions

I've put together a basic applet where the user selects a file from their hard drive, it reads the first line of this file and passes that off to JavaScript for some additional preprocessing, and then when you click a button it tries to upload that file through an HTTP POST request. I found a very basic open source applet for uploading f...

Java applet with init() in a package?

Hi. I'm wondering if you can put the main class (or the class with the init method, whatever) inside a package and still have it run in a browser? Most of the time I put my applets into the (default package) but my applet here is in a package, so can I still embed it into the webpage? I've googled it with little results. Say I've got M...

How to deploy an applet?

I've built a small applet and I have all the .java class files. How can I now compile/build it so I can use it in an <applet> tag? An eclipse based method would be best. Also, I'm using some images in the applet. 1) Do I need to upload these images to my website 2) Right now I point to them using my local path e.g C:\java\project\imag...

Having a lot of trouble deploying a java applet

I'm new to Java. I'm simply trying to build a .jar file of my applet so I can run it from my browser. This is what my directory structure looks like: C:\java\pacman\src contains all of the .java class files. C:\java\pacman\assets contains about 4-5 images and audio files. If I try to use the following code: Image someFile=getCod...

How to use sound and images in a Java applet?

Question 1: How should I structure my project so the sound and images files can be loaded most easily? Right now, I have the folder: C:\java\pacman with the sub-directory C:\java\pacman\src containing all the code, and C:\java\pacman\assets containing the images and .wav files. Is this the best structure or should I put the asse...

Java - getClassLoader().getResource() driving me bonkers

I have this test app: import java.applet.*; import java.awt.*; import java.net.URL; public class Test extends Applet { public void init() { URL some=Test.class.getClass().getClassLoader().getResource("/assets/pacman.png"); System.out.println(some.toString()); System.out.println(some.getFile()); System.out.pr...

What to replace this java code with?

The following code is used for playing a sound file in my java applet: public synchronized void play() { try { //Here filename is a URL retreived through //getClassLoader().getResource() InputStream in = new FileInputStream(filename.getFile()); AudioStream as = new AudioStream(in); ...

drawImage() for .png files doesn't work in Java applet?

I made this pacman game using an applet. When the applet finishes loading, it is meant to display a 'start menu' graphic i made which says 'Double click to start the game', etc. The graphic would take up the whole 400x400 applet. Here's the code: public void paint(Graphics g) { if (! isRunning) { switch (result) { case 0: s...

drawImage in Java applet flickers in Safari

I'm having a flicker problem in a Java applet in Safari (Mac). However, it's not the usual double buffering problem. I have isolated it down to one single drawImage call (no redundant repaint, no clear is called), which gives a white flicker before painting the image but not on every repaint. In fact, I measured the duration of the draw...

Java: Reading a pdf file from URL into Byte array/ByteBuffer in an applet.

I'm trying to figure out why this particular snippet of code isn't working for me. I've got an applet which is supposed to read a .pdf and display it with a pdf-renderer library, but for some reason when I read in the .pdf files which sit on my server, they end up as being corrupt. I've tested it by writing the files back out again. I'...

how embed windows program into java applet?

how i embed a running windows program into java applet, like notepad, mspaint,... ...

Applet hangs in IE during security phase

The applet is in a signed JAR. Last line in console reads: security: Checking if certificate is in Deployment permanent certificate store CPU and memory usage are normal. Other page elements still respond. It's just that the applet is not displayed. There is another applet in the same page but it works. Any ideas? Thread dump fo...

Java Applet z-index problem; Safari and beyond

A well known problem with Java Applets in webpages is that browsers ignore the z-index of the applet tag vs. other components in the page. No matter how you position and z-index elements in the page, applets will draw themselves on top of everything. There is a workaround, known as the iframe shim, is described here: http://www.oratran...

Java applet white screen

I'm trying to get to the bottom of a problem with our Java applet based program. It quite regularly seizes up with an unresponsive GUI (or a white screen). This of course only happens when deployed at a customer site :-(. They are running a version of the Sun JVM in 1.5 series (not sure the exact release). We have a theory that it's to ...

Dynamically loading a native library inside Java applet

I am trying to write a Java applet that will read from a user's serial port. For this I am using the Java Comm API in conjuction with the RXTX library. I've successfully managed to read data through a local Java application but I can't seem to do the same from within an applet. The problem is that the RXTX library is a native library and...

Which do you prefer: Java Web Start, or Java Applets?

Which do you think is better as a programmer, and as a end user, and why? ...

What Java versions are commonly installed on browsers, is it safe to assume 1.4?

Is there any site/analysis about what Java version most people are using on WWW ? It seems this data is not available on webserver logs (vs. Flash versions) Can we safely set e.g. Java 1.4.2 as minimum requirement for our applet, or are there still many users using Java 1.1 (MS one) or Java 1.2-1.3 ? It's still a bit of a complicated p...

ClassNotFoundException in Java Applet using <object> tag

Hi there. I'm trying to embed a Java Applet using the <OBJECT> tag, which is the XHTML Strict way of doing it. After browsing lots of sites, I tried this example which seems to work pretty well: <!--[if !IE]> Firefox and others will use outer object --> <object classid="java:Sample2.class" type="application/x-java-applet"...

How to convert a Swing Application to an Applet?

I created a desktop application with Swing Application Framework, now how can I convert it to an applet? The main class extends SingleFrameApplication. EDITED: This is the starting class, used NetBeans GUI builder: public class PhotoApp extends SingleFrameApplication { /** * At startup create and show the main frame of the ap...

How to Prevent an Applet from Unloading across web pages?

I have a large applet that takes some 40 seconds to initialize (cabs are cached so ignore download time for this question). The issue is, if the user goes to Page A which launches the applet (single window) and then navigates to page B, the applet is unloaded. If the user goes back to Page A, they incur the 40 seconds init time once ag...