Of course. Make a file which contains exactly what you would have typed at the command line, and then run your application with that file redirected to standard input.
So normally you would run the application like this:
java YourClass
or maybe something a bit more complicated than that, but let's just use that as an example. This will expect you to type the input at the command line. To provide input from a file, run the application like this:
java YourClass < control.txt
This will take the output from the "control.txt" file in the current working directory instead of expecting command-line input from you.
By the way this is a standard feature of the command line no matter whether it's the Windows command line or a *nix shell. It's nothing to do with Java, it works for all applications which read from standard input.