wood burning stoves*
The moose likes General Computing and the fly likes start a program at window startup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "start a program at window startup" Watch "start a program at window startup" New topic
Author

start a program at window startup

Saurav Suman
Greenhorn

Joined: Jul 02, 2013
Posts: 20
can i create the code for start the program at window startup

if anybody can help me then help me buddy i am leaner
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
You mean at "Windows" startup? Since you posted this in the servlets forum I'm assuming you want this code to run in a servlet container for some reason. The only way to do that would be to put the code in a servlet context listener of your web app, and set up the servlet container to run at startup time. Tomcat can be installed as a Windows service, and a Windows service can be set to run at startup, so that should do the trick.


Ping & DNS - my free Android networking tools app
prasad guna
Ranch Hand

Joined: Feb 12, 2009
Posts: 43

Hi The question is not clear what you want exactly window start up means web application or stand alone application if its web use onLoad() java script function.


Prasath.G
SCJP
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
prasad guna wrote:if its web use onLoad() java script function.

That is very unlikely to be the solution - it not only assumes that a servlet container will start, but also that a web browser will start and load a particular page after the servlet container has started. Executing code at servlet container startup time is what servlet context listeners are for.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 867
    
    5
prasad guna wrote:window start up means ... use onLoad() java script function.



"Window start up" can be understood as "when a HTML page has been loaded", so it that case the onload approach makes sense.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: start a program at window startup