What exactly didn't work? Did you receive an error? If you did, please post it. What results were you expecting?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
posted 8 years ago
Sorry for it's taking so long to reply. It's kind of bit embarrassment. I'm new to java and didn't know if people have done this and I'm a laggard.
I'm trying to capture a screenshot with java applet but it didn't seem to work. I can't invoke the subclass set of java application to automate.
Bellow is my experimenting so far, would be greatly appreciated if you can point out where it went wrong:
First of all, your comment is incorrect in that fragment from your post. You don't "invoke" a class in Java (except in that uncommon situation where you're running a class from the command line). What your code does is to create an instance of that class, nothing else. You apparently thought that "invoking" a class would call a method which happened to called "main". That's not the case either. If you want that method to be called, you're going to have to call it.
Although I wouldn't call it "main", that doesn't describe its function at all. I would call it "capture" or something like that. And I would get rid of the String-array parameter, since you don't use that anywhere in the method.
posted 8 years ago
Your comment is complicated to me. I don't understand it right now, because I'm new to this java thing. But I would try to understand it. Maybe I should start with the "call" method you mentioned. The "invoke" word was just borrowed from Oracle's tutorial website. I don't really understand what does it mean right now.