Window freezes when pressed CTRL + P

S

srinivas.veeranki

In my application, When I Select File -> Print option the following
code executes fine, Where as I pressed CTRL + P from Keyboard my system

is hanging at this statement PrintService service =
ServiceUI.printDialog(null, 200, 200,printService, defaultService,
flavor, pras);

The following is the code, I used in my application. Please Help me
regaurding this.


PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
DocFlavor flavor =
DocFlavor.INPUT_STREAM.PNG;
PrintService printService[] =
PrintServiceLookup

..lookupPrintServices(flavor, pras);
PrintService defaultService =
PrintServiceLookup

..lookupDefaultPrintService();
PrintService service =
ServiceUI.printDialog(null, 200, 200,
printService,
defaultService, flavor, pras);
if (service != null) {
new PrintTask(service,
pras).start();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top