Continuously Execute a program


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Continuously Execute a program

  1. #1
    Join Date
    Jul 2004
    Posts
    2

    Continuously Execute a program

    Hi

    I need help with a java program. I have written a program that reads file1, which is outputted by another program. Within file1 is the location of file2. It gets file2 from the location sepcified and extracts the relevant information from it and creates file3. the program then reads the contents of file3 and outputs it to a JTable in a JPanel (along with some other calculations)

    The problem is that file1 changes every hour or so and the contents of file2 change all the time. I need some way of continuously executing "main" so that it will pick up these changes and then I can repaint the JTable.

    Any ideas would be apreciated

    Thanks
    Steve

  2. #2
    Join Date
    Feb 2004
    Posts
    808
    public static void main(String[] argv){

    for(;{
    //do stuff
    try{Thread.sleep(1000 * 60* 60);}catch(InterruptedException ie){}
    }
    }
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

  3. #3
    Join Date
    Feb 2004
    Posts
    808
    Code:
    public static void main(String[] argv){
    
      for(;;){
        //do stuff
        try{Thread.sleep(1000 * 60* 60);}catch(InterruptedException ie){}
      }
    }
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

  4. #4
    Join Date
    Jul 2004
    Posts
    83
    cool wha'ts that do?
    They say if you play a Microsoft Windows CD backwards it will play satanic messages. But thats nothing, if you play it forwards it installs Windows.

  5. #5
    Join Date
    May 2004
    Posts
    219
    Originally posted by Sportsdude11751
    cool wha'ts that do?
    It does something, sleeps for an hour, then does it again, endlessly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center