Java Process Scheduler Goes Applet!

| | Comments (2)
I should be studying for my physics test next tuesday. Or finishing the CS203 assignment that is also due...tuesday. But instead I hacked on my proc scheduler becuase Guild came over and he ... well ... made me because I started bitching about manifest files or some shit. Try it! Like the title says it's an applet now. Some details...

Anything that has to be opened out of a jar file over the internet will be fundamentally gay and impossible. Getting things out of jar files isn't easy. Google solved most problems for me. Even java has it on some remote developer faq.

This is what my applet html looks like


<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width="0" height="0" align="baseline"
    codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">
    <PARAM NAME="code" VALUE="JunkApplet.class">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.2.2">
    <PARAM NAME="archive" VALUE="cpu.jar">
<PARAM NAME="scriptable" VALUE="true">
<COMMENT>
    <EMBED type="application/x-java-applet;version=1.2.2" width="0"
       height="0" align="baseline" code="JunkApplet.class" archive="cpu.jar"
       pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html">
    <NOEMBED>
    </COMMENT>
           No JDK 1.2 support for APPLET!!
    </NOEMBED></EMBED>
</OBJECT>

It's more complicated and lamely-gay than you want to have to read about. But it loads a class file from a jar file in both ie & netscape.

The class is just a stupid Applet with an init that creates a new CPUSchedulerFrameForApplet. I had to change my image loading code to be more like this using the URL class. I also had to remove any file IO from the applet. I didn't want the main app to lose functionality. So I branched CPUSchedulerFrame into CPUSchedulerFrameForApplet. CPUSchedulerFrame retains all the original app functionality and file IO. Both are compiled in the jar and tar.gz, and it is a lot of redundant code, but it was quick and easy and nothing but net.

This is a good release to round out the app. A lot of OS students have written me about this project. But they were generally daring enough to wonder why I hadn't done an applet, download the broken jar, and finally compile it themselves from the quite useful tar.gz. Now you can *really* use the applet from the jar file, run the jar file on the console, and read the source in the tar.gz file.

That last batch of fixes made it infinitely usable by anyone who could do java. Now I think it will be more approachable. It will appeal to the "instant gratification" crowd. It would be invaluable for introducing schedulers in the classroom.

Plus, it's just swanky as hell! `

2 Comments

adasdasd

Hi, Just wondering if Windows would work the same way your kind of home search engine is working. That CPU Scheduler is a masterpiece. I wouldn't mind if I get the source code to play with it.
Sicerely,
DL