Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Editable screensaver that is running all the time

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Basically, this is an overlay of the screen. It is a screensaver, if you will. What happens is when you click on it, it goes away. If you click on the tab in the bottom, it comes back up. You can draw on it by dragging the mouse over the surface. What I want to happen is if you click, it still shows up, but the underlying programs can run. You should be able to click on them and do everything normal. When you drag your mouse again, it should go back to the "screensaver" program. How would I do this? This above code is fully runnable and works fine. I just want to add this final feature. I am just not sure how. Would I use the Robot class or would that just do stuff to the Java program? Or (very crappy solution), if the user clicked, I use the Robot class and if they click on something, it hides the window, clicks, then brings it back up again. This is not what I am looking for, but it is something I've thought of. Same for the typing. How do I get this to work properly?

NOTE: I am NOT looking for it to disappear. I want it always showing, but the OS and other programs able to have full mouse and keyboard support (except for the dragging of course).

Thanks,
cc11rocks aka John Price
 
randy orton
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
john price wrote:
Basically, this is an overlay of the screen. It is a screensaver, if you will. What happens is when you click on it, it goes away. If you click on the tab in the bottom, it comes back up. You can draw on it by dragging the mouse over the surface. What I want to happen is if you click, it still shows up, but the underlying programs can run. You should be able to click on them and do everything normal. When you drag your mouse again, it should go back to the "screensaver" program. How would I do this? This above code is fully runnable and works fine. I just want to add this final feature. I am just not sure how. Would I use the Robot class or would that just do stuff to the Java program? Or (very crappy solution), if the user clicked, I use the Robot class and if they click on something, it hides the window, clicks, then brings it back up again. This is not what I am looking for, but it is something I've thought of. Same for the typing. How do I get this to work properly?

NOTE: I am NOT looking for it to disappear. I want it always showing, but the OS and other programs able to have full mouse and keyboard support (except for the dragging of course).

Thanks,
cc11rocks aka John Price

hello John Prince.......
if(window.isVisible()) window.toBack();
else window.toFront();
just add this in your mouseclicked and this will work for u.......bye have a good time.
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This just hides the JFrame. I do not want to hide the JFrame.
Thanks,
cc11rocks aka John Price
 
randy orton
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
john price wrote:This just hides the JFrame. I do not want to hide the JFrame.
Thanks,
cc11rocks aka John Price

Hello john......
add this to your code.
When you click on an application running behind your jframe.Your mouse control simply transfers to that.Yes your
drag will not work(you cannot draw) while dragging on the application.But when you drag outside it you are back again to your jframe.
I must tell you there is no way to get events outside your your java window.
This link might help you.....javadocs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic