*
The moose likes Swing / AWT / SWT and the fly likes My app inactive obtain the focus of windows system how? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "My app inactive obtain the focus of windows system how?" Watch "My app inactive obtain the focus of windows system how?" New topic
Author

My app inactive obtain the focus of windows system how?

Juan Carlos Oidor Gonzalez
Greenhorn

Joined: Feb 17, 2004
Posts: 4
Hello, I need that my application run in background, but it can obtain the focus (be the active window) of system in ms windows after 2 or 5 minutes, How can I do it?
BTW, some good tool to build gui with swing vb-style? (no commercial, if is possible, i need to teach)
Thanks in advance
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
look at java.awt.Component.requestFocus()
Netbeans comes with a gui builder.
D.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

When you say you want your app to "run in background", do you mean you want the window to be up, but other windows to be on top of it, or do you mean no gui at all for your app.

In either case, you're going to need another thread to do this. Here's some code that shows how to make an app "sleep" for a certain number of seconds...



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: My app inactive obtain the focus of windows system how?
 
Similar Threads
Listening keyboard and mouse events in the background
To extract the timezone from the system
Window services!!!! Help required
Panel loses focus when Tab is pressed?
how to make a system dual boot