dialog.addDoneAction(
new ActionListener() {
public void actionPerformed(ActionEvent event) {
PrintLayoutModel layout = dialog.getPrintLayout();
doc.setPrintLayout(layout);
dialog.dispose();
if (callback != null)
callback.done();
LastPrintLayout = layout;
savePrefs();
}