Welcome to JavaRanch.
I'm confused - you're posting this in the
Applet forum, so I'm guessing the code runs as part of an applet? If so, then it's not possible that the GUI would be shown on the server.
If, on the other hand, the code currently is part of a web app, then it would make sense that the print dialog is shown on the server (and thus useless). In that case, why not stream the PDF to the client, and let the user decide what to do with it - open it, save it, print it, whatever?