printerFontData = text.getFont().getFontData(); printerForeground = text.getForeground().getRGB(); printerBackground = text.getBackground().getRGB();
	void menuPrint() {		PrintDialog dialog = new PrintDialog(shell, SWT.NONE);		PrinterData data = dialog.open();		if (data == null) return;		if (data.printToFile) {			data.fileName = "print.out"; // you probably want to ask the user for a filename		}				/* Get the text to print from the Text widget (you could get it from anywhere, i.e. your java model) */		textToPrint = text.getText();		/* Do the printing in a background thread so that spooling does not freeze the UI. */		printer = new Printer(data);		Thread printingThread = new Thread("Printing") {			public void run() {				print(printer);				printer.dispose();			}		};		printingThread.start();	}