The Problems
So there were many problems with my idea. I had no trouble downloading the vxp.jar or understanding the basic functions of the WebCam application. With Dan's help, I created a new class called Cattimelapse that would extend WebCam and change the method newFrame so that the application, instead of capturing an image with a key press, iwould capture an image based on the current time, At first it seemed to be working but then something happened. The first problem was that I stopped getting live video in the left side of the window. I solved this, after some help, by removing the following statements from my if statement:
ps.grabFrame();
liveImage = ps.getImage();
repaint();
Unfortunately, this did not solve the problem that the application was only capturing a JPEG freezeframe when the application first began and then not doing so ever again. I thought that the problem lay in the variable lasttimetaken
public void newFrame (){
long now = System.currentTimeMillis();
if (now- lasttimetaken >1000*60*60){
lasttimetaken = now;
grabPicture(freezeFrame);
makeJPegFile(freezeFrame, "C:\\",getTimeString()+ "test.jpg", 1.0f);
//postFileToITP("C:\\", "test.jpg", "/home/clc219/public_html/VideoSensing/", "WC" + getTimeString() + ".jpg" );
}
ps.grabFrame();
liveImage = ps.getImage();
repaint();
}
It seems that with this method lasttimetaken would always be equal to the current time. It was then suggested to me that I needed a listener that would inform me when the system current time had changed. I tried to implement this but I couldn't figure out how to create the method. I am now hopelessly stuck and confused as to how it ever worked in the first place.