• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

My app inactive obtain the focus of windows system how?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
look at java.awt.Component.requestFocus()
Netbeans comes with a gui builder.
D.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...

 
reply
    Bookmark Topic Watch Topic
  • New Topic