Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My app inactive obtain the focus of windows system how?

 
Juan Carlos Oidor Gonzalez
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
look at java.awt.Component.requestFocus()
Netbeans comes with a gui builder.
D.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic