public void actionPerformed(ActionEvent ev){
  ClusterViewer viewer=getViewer();
  PageFormat pageFormat=ProgramProperties.getPageFormat();
  PrinterJob job=PrinterJob.getPrinterJob();
  if (pageFormat != null)   job.setPrintable(viewer,pageFormat);
 else   job.setPrintable(viewer);
  if (job.printDialog()) {
    try {
      job.print();
    }
 catch (    Exception ex) {
      Basic.caught(ex);
      NotificationsInSwing.showError(viewer.getFrame(),"Print failed: " + ex);
    }
  }
}

public void actionPerformed ( ActionEvent ev ) { ClusterViewer viewer = getViewer ( ) ; PageFormat pageFormat = ProgramProperties . getPageFormat ( ) ; PrinterJob job = PrinterJob . getPrinterJob ( ) ; if ( pageFormat != null ) job . setPrintable ( viewer , pageFormat ) ; else job . setPrintable ( viewer ) ; if ( job . printDialog ( ) ) { try { job . print ( ) ; } catch ( Exception ex ) { Basic . caught ( ex ) ; NotificationsInSwing . showError ( viewer . getFrame ( ) , "Print failed: " + ex ) ; } } }
action to be performed
