final RevalidateListener revalidateListener = new RevalidateListener();
previewPane = new PageFormatPreviewPane();
pageFormatBox = new JComboBox(new DefaultComboBoxModel(PageFormatFactory.getInstance().getPageFormats()));
pageHeightField = new JTextField();
pageHeightField.setColumns(5);
pageHeightField.getDocument().addDocumentListener(revalidateListener);
pageWidthField = new JTextField();
pageWidthField.setColumns(5);
pageWidthField.getDocument().addDocumentListener(revalidateListener);
landscapeModeBox = new JCheckBox();
landscapeModeBox.addActionListener(new OrientationChangeListener());
portraitModeBox = new JCheckBox();
portraitModeBox.addActionListener(new OrientationChangeListener());
preDefinedPageSizeBox = new JCheckBox();
preDefinedPageSizeBox.addChangeListener(new PageSizeCheckBoxSelectionAction());
userDefinedPageSizeBox = new JCheckBox();
userDefinedPageSizeBox.addChangeListener(new PageSizeCheckBoxSelectionAction());
final ButtonGroup pageSizeGroup = new ButtonGroup();
pageSizeGroup.add(preDefinedPageSizeBox);
pageSizeGroup.add(userDefinedPageSizeBox);
spanHorizontalField = new JTextField();
spanHorizontalField.setColumns(5);
spanHorizontalField.getDocument().addDocumentListener(revalidateListener);
spanVerticalField = new JTextField();
spanVerticalField.setColumns(5);
spanVerticalField.getDocument().addDocumentListener(revalidateListener);
marginTopField = new JTextField();
marginTopField.setColumns(5);
marginTopField.getDocument().addDocumentListener(revalidateListener);
marginLeftField = new JTextField();
marginLeftField.setColumns(5);
marginLeftField.getDocument().addDocumentListener(revalidateListener);
marginBottomField = new JTextField();
marginBottomField.setColumns(5);
marginBottomField.getDocument().addDocumentListener(revalidateListener);
marginRightField = new JTextField();
marginRightField.setColumns(5);
marginRightField.getDocument().addDocumentListener(revalidateListener);
final ButtonGroup orientationGroup = new ButtonGroup();
orientationGroup.add(portraitModeBox);