How to perform printing task using java swing?