Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

java screensaver?

  • 08-04-2005 8: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 Posts: 2,013 ✭✭✭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 Posts: 2,013 ✭✭✭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