Tuesday, April 06, 2010


Just to add some features to DowneastBlog, I wanted to equip it with some Java applets. In practice these should look like applications in the side"bar" to the right. Now, when you scroll down you'll see there, at the bottom, a blank rectangle. That's supposed to be a Java applet. I named that applet simply "AppletDemo". Normally, the only thing it should do, since it is merely a test, is show a black rectangle and circle. The code I included in DB's web page is:

applet codebase="http://users.skynet.be/OUTLAWMIKESSITE/" height="200" width="200" code="AppletDemo.class"

... which I wrote of course between the appropriate brackets, and afterwards terminated with a closing applet-tag, and...

... wherein the argument "codebase" points to the absolute domain where I have stored the binary code of AppletDemo, and the file that contains it, AppletDemo.class. Since I cannot store the file AppletDemo.class on the same server as DowneastBlog, I have to place it somewhere else, and luckily I have this junkyard site of mine, http://users.skynet.be/OUTLAWMIKESSITE/, which I use mainly for storing pics. So that's why the codebase arg. As a sidenote, I might add that I wrote the sourcecode of AppletDemo using ECLIPSE (which I can recommend, btw), and that it compiled this sourcecode, AppletDemo.java, in AppletDemo.class. Also as a sidenote, the uploader software I used to get the AppletDemo.class file to OUTLAWMIKESSITE is "Classic FTP", which looks very much like Ipswitch software (which I used before) and is extremely easy to operate.

... and oh yeah, OUTLAWMIKESSITE is a bogus name for reasons of privacy...

Now, as for the code in AppletDemo.java, it's simply this:

package h02;

import javax.swing.*;
import java.awt.*;

public class AppletDemo extends JApplet

public void paint(Graphics g)
g.fillRect(50, 50, 25, 50);
g.fillOval(60, 30, 50, 50);


And, being poepsimpel it works of course just fine on the ECLIPSE platform.

Have I got you this far? You must be a geek. Okay.

So... the line of code in DB is okay, and if not I'll eat my shoes.
The sourcecode of AppletDemo is okay too, and so must be the binary code.
AppletDemo.class is in an appropriate location, and the codebase and code arguments point to its correct whereabouts.

On my web browser, Java is enabled.


If you have a hunch why not, please feel free to drop a line in the comments section. I'll get you a Nobel Prize for Numbnuts Assistance, I swear it.


No comments: