My suggestion is to try writing the code yourself, and if stuck come back. Robot can be used to have a Java program click another program's buttons.