Please
UseCodeTags (← click) when posting code as it makes it easier for people to read your code. I've added them for you this time.
What application is opening to print the file, and is it closing after printing?
As I said in my previous post you can't control the visibility of the application. If your application isn't closing after it has printed and you are on a Windows machine you can print text files using Notepad by using java.lang.Process (created from java.lang.ProcessBuilder) ie:
This will open Notepad displaying the file, print it and then close notepad.