title: How to enable landscape orientation in PrinterJob.pageDialog
body: <p>I want to have option to set a page format in PrinterJob.pageDialog and the only missing is to change page orientation, because the radio button for landscape mode is disabled.</p>
  
  <p>The <b>problem</b> is that I do not know how to enable this radio button representing landscape mode in this dialog. It is only enabled when the orientation mode is set to landscape before opening the dialog. This is not a good solution for me since I want always to show to the user his previous selection, when he opens the dialog again, while giving him option to change it.</p>
  
  <p>I really would like to avoid building a dialog myself since this look perfect.</p>
  
  <p><i>I heard that it might be an issue present only on Window machines.</i>
  Please, let me know if it occurs also on other platforms.</p>
  
  <p>Thanks in advance. </p>
  
  <pre><code>
  
  import java.awt.Event;
  import java.awt.event.ActionEvent;
  import java.awt.event.KeyEvent;
  import java.awt.print.PageFormat;
  import java.awt.print.PrinterJob;
  import javax.swing.AbstractAction;
  import javax.swing.JFrame;
  import javax.swing.JMenu;
  import javax.swing.JMenuBar;
  import javax.swing.KeyStroke;
  
  public class PrintDialogSSCCE extends JFrame
  {
      private static final long serialVersionUID = 1L;
      private PageFormat pageFormat;
  
      public PrintDialogSSCCE()
      {
          super();
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          PrinterJob pj = PrinterJob.getPrinterJob();
          pageFormat = pj.defaultPage();
  //      pageFormat.setOrientation(PageFormat.LANDSCAPE);
          JMenuBar mb = new JMenuBar();
          JMenu file = new JMenu("File", true);
          file.add(new FilePageSetupAction()).setAccelerator(
                  KeyStroke.getKeyStroke(KeyEvent.VK_P, Event.CTRL_MASK
                  | Event.SHIFT_MASK));
          mb.add(file);
          setJMenuBar(mb);
      }
  
      public class FilePageSetupAction extends AbstractAction
      {
          private static final long serialVersionUID = 1L;
  
          public FilePageSetupAction()
          {
              super("Page setup...");
          }
          @Override
          public void actionPerformed(ActionEvent ae)
          {
              PrinterJob pj = PrinterJob.getPrinterJob();
              pageFormat = pj.pageDialog(pageFormat);
          }
      }
  
      public static void main(String[] args)
      {
          PrintDialogSSCCE pd = new PrintDialogSSCCE();
          pd.setSize(300, 300);
          pd.setVisible(true);
      }
  }
  
  </code></pre>