Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Printing a shell
Printing a shell [message #756442] Sun, 13 November 2011 06:28 Go to previous message
Lorenzo  is currently offline Lorenzo
Messages: 2
Registered: November 2011
Junior Member
Hi all, I'm lorenzo and I'm new in this forum.

I write you because I can't print with swt library.

I have a Shell with some elements I'd like to print all contents in the shell (like a printscreen). I find some examples, but at the moment I print a white paper.

the code that I insert in the click-event of a button is:

PrintDialog printDialog = new PrintDialog(shell); // "shell" is the most bigger object that contain all the items I'd like to print
PrinterData printerData = printDialog.open();
Printer printer = new Printer(printerData); 
printer.startJob("");
printer.startPage();
GC gc = new GC(printer);

printer.endPage();
gc.dispose();
printer.endJob();				
printer.dispose();


Someone can help me?!?

Thanks in advance

Lorenzo
 
Read Message
Read Message
Read Message
Previous Topic:How to call a section in SWT?
Next Topic:not able to get back and forward function in browser widget
Goto Forum:
  


Current Time: Sat May 25 06:51:42 EDT 2013

Powered by FUDForum. Page generated in 0.05940 seconds