);
dialog.addPageSetupAction(
new ActionListener() {
public void actionPerformed(ActionEvent event) {
PrinterLayer printer = Platform.getPlatform().getPrinterLayer();
PageFormat format = printer.pageDialog(null);
if (format != null)
dialog.setPageFormat(format);
}
}