page.add(setPortAttributes); page.add(setLandAttributes);
JPanel pagePage = new JPanel();
   public void initPanel() throws Exception  {      setLayout(new BorderLayout());      contentPane = new JPanel();      contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS));      add(contentPane,BorderLayout.NORTH);      // define ppPanel panel      JPanel ppp = new JPanel();      ppp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.print")));      defaultPrinter = new JCheckBox(LangTool.getString("sa.defaultPrinter"));      if (getStringProperty("defaultPrinter").equals("Yes"))         defaultPrinter.setSelected(true);      ppp.add(defaultPrinter);      //--- Create a printerJob object      PrinterJob printJob = PrinterJob.getPrinterJob ();      // will have to remember this for the next time.      //   Always set a page format before call setPrintable to      //   set the orientation.      PageFormat pf = printJob.defaultPage();      pappyPort = pf.getPaper();      pappyLand = pf.getPaper();      // Portrait paper parameters      if (getStringProperty("print.portWidth").length() != 0 &&            getStringProperty("print.portHeight").length() != 0 &&            getStringProperty("print.portImageWidth").length() != 0 &&            getStringProperty("print.portImageHeight").length() != 0 &&            getStringProperty("print.portImage.X").length() != 0 &&            getStringProperty("print.portImage.Y").length() != 0) {         pappyPort.setSize(Double.parseDouble(getStringProperty("print.portWidth")),                           Double.parseDouble(getStringProperty("print.portHeight")));         pappyPort.setImageableArea(Double.parseDouble(getStringProperty("print.portImage.X")),                           Double.parseDouble(getStringProperty("print.portImage.Y")),                           Double.parseDouble(getStringProperty("print.portImageWidth")),                           Double.parseDouble(getStringProperty("print.portImageHeight")));      }      // Landscape paper parameters      if (getStringProperty("print.landWidth").length() != 0 &&            getStringProperty("print.landHeight").length() != 0 &&            getStringProperty("print.landImageWidth").length() != 0 &&            getStringProperty("print.landImageHeight").length() != 0 &&            getStringProperty("print.landImage.X").length() != 0 &&            getStringProperty("print.landImage.Y").length() != 0) {         pappyLand.setSize(Double.parseDouble(getStringProperty("print.landWidth")),                           Double.parseDouble(getStringProperty("print.landHeight")));         pappyLand.setImageableArea(Double.parseDouble(getStringProperty("print.landImage.X")),                           Double.parseDouble(getStringProperty("print.landImage.Y")),                           Double.parseDouble(getStringProperty("print.landImageWidth")),                           Double.parseDouble(getStringProperty("print.landImageHeight")));      }      // define page panel      JPanel page = new JPanel();      page.setBorder(BorderFactory.createTitledBorder(                           LangTool.getString("sa.pageParameters")));      setPortAttributes = new JButton(LangTool.getString("sa.columns24"));		setPortAttributes.addActionListener(new java.awt.event.ActionListener() {			public void actionPerformed(ActionEvent e) {				getPortraitAttributes();			}		});      setLandAttributes = new JButton(LangTool.getString("sa.columns132"));		setLandAttributes.addActionListener(new java.awt.event.ActionListener() {			public void actionPerformed(ActionEvent e) {				getLandscapeAttributes();			}		});      page.add(setPortAttributes);      page.add(setLandAttributes);      contentPane.add(ppp);      contentPane.add(page);//      contentPane.add(ppa);   }