Write a batch file will do it. Another thing you can do is use "ant", the apache.org open source utility. It will check and build all changed java file for you.
Or if you know in advance what are the 3 or 4 files you want to compile, just list all their names after javac. E.g. javac FileA.java FileB.java FileC.java Dunno if that's what you meant , but if so, it's easy to do.