Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

java screensaver?

  • 08-04-2005 09:28AM
    #1
    Closed Accounts Posts: 839 ✭✭✭


    what would I have to turn a java program into a screensaver?


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Might not be possible.

    As far as I recall, SCR files are basically EXE files that have two parameters (which I forget). One parameter is for settings, one is for running the screen saver. Other then that its a normal exe.


  • Registered Users, Registered Users 2, Paid Member Posts: 2,032 ✭✭✭lynchie


    You need to write a c/c++ program that uses JNI to call your java app. Read up on Sun's JNI tutorial for more info


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    lynchie wrote:
    You need to write a c/c++ program that uses JNI to call your java app. Read up on Sun's JNI tutorial for more info

    Intresting.. wouldn't the Java application need to be running all the time?


  • Registered Users, Registered Users 2, Paid Member Posts: 2,032 ✭✭✭lynchie


    Not really.. AFAIK the scr file which is a plain windows exe is called by the OS with two parameters /c and /s. If /c is passed you show the standard config window, is /s is shown you show the screensaver. Only one instance can run at any given time. It would be tricky though as your app would have to exit once a mouse move or key press is made. So unless you java app is a a swing gui with a listener on mouse/key events it would be pointless trying to use a java app as a screensaver in the first place.


  • Closed Accounts Posts: 839 ✭✭✭zap


    ye it is swing gui with mouse/key action listeners, it has its own config so how would i go about it


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    Possibly (and I'm not up on my Windows programming, so don't take this as gospel) write a simple C program that just does a system call for "java -jar yourprogram.jar". Other than that, you're stuck with JNI, see Sun's website.


  • Closed Accounts Posts: 839 ✭✭✭zap


    what if i was making it for *unix?


  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    For unix I'm fairly sure you can do it with a script. XScreensaver will pass it some stuff; see its docs for more details.


Advertisement