import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.printing.Printer;
public class DrawTextToPrint {
public static void main(String[] args) {
Printer printer = new Printer();
if (printer.startJob("Printing . . .")) {
GC gc = new GC(printer);
if (printer.startPage()) {
gc.drawText("Hello, World!", 20, 20);
printer.endPage();
}
gc.dispose();
}
printer.dispose();
}
}
|