JScreenSaver (41kb)
The little package contains a bunch of files:
A little demo:
demo/demo.jar
demo/demo.scr
And the source:
src/icon.ico (ultrasweet 80ie flavoured icon ;D)
src/jsaver.cpp
src/PlasmaFS.java
It’s pretty simple and easy to use. The doubleclickable jar and the scr need to be in the same directory and both files must have the same basename (eg moo.scr -> moo.jar or test.scr -> test.jar). So… there is no need to recompile it. Rename it and you are done
The scr does absolutly nothing except launching a jar file with the same basename as itself. It doesnt care about a preview, password, change password, configuration or exiting of your programm. Just make sure that your java application exits if any event occurs (key, mouse or mousemotion) and it will just behave like any other screensaver.
enableEvents
(
AWTEvent.KEY_EVENT_MASK|
AWTEvent.MOUSE_EVENT_MASK|
AWTEvent.MOUSE_MOTION_EVENT_MASK
);
[...]
public final void processEvent(AWTEvent e)
{
run=false; //die! die! die!
}
That usually does the trick (for Java2D stuff)… well ok and mwheelup/down doesn’t exit the programm, but I guess it’s good enough for a little demo.
The license is - do what you wanna do with it and don’t sue me
That process creation part is (iirc) from jbanes, that for(;; ) snipped is from a forum and the other ugly pieces of bad C code were added by me… oh and I pixelated that icon
If you add something usefull, make it public for the community. Thanks ;D