This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes how to implement the processing of events without creating a window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to implement the processing of events without creating a window" Watch "how to implement the processing of events without creating a window" New topic
Author

how to implement the processing of events without creating a window

Yuriy Paholkov
Greenhorn

Joined: May 27, 2010
Posts: 2
Hello I am writing a program, take a screenshot by pressing F9. Processor keystrokes exists for JFrame, but how to do this handler without creating a window? Here code
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

You can't. At best, a command line application could process typed input AFTER the enter key is pressed to pass that input to your program.

Or look into JCurses (never used it nor taken a look at it myself).


luck, db
There are no new questions, but there may be new answers.
Yuriy Paholkov
Greenhorn

Joined: May 27, 2010
Posts: 2
Thank you for your reply. Sorry for probably stupid question, but is it possible then to make a window invisible? does not turn into the tray, but it is invisible, but retaining the ability to process events?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

No
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19552
    
  16

Windows only process key and mouse events if that window is the active window. If it's invisible it will never be the active window.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to implement the processing of events without creating a window
 
Similar Threads
keypress + Robot + Method
nullPointerException found regarding Window
Capturing Screen
How to transfer a bufferedImage Object?
random mouse pointer movement