001package jmri.jmrit.mailreport; 002 003import java.awt.event.ActionEvent; 004import javax.swing.AbstractAction; 005import org.slf4j.Logger; 006import org.slf4j.LoggerFactory; 007 008/** 009 * Swing action to create and register a ReportFrame object 010 * 011 * @author Bob Jacobsen Copyright (C) 2009 012 */ 013public class ReportAction extends AbstractAction { 014 015 public ReportAction(String s) { 016 super(s); 017 } 018 019 public ReportAction() { 020 this(java.util.ResourceBundle.getBundle("jmri.jmrit.mailreport.ReportBundle").getString("Name")); 021 } 022 023 @Override 024 public void actionPerformed(ActionEvent e) { 025 ReportFrame f = new ReportFrame(); 026 try { 027 f.initComponents(); 028 } catch (Exception ex) { 029 log.error("Exception in startup", ex); 030 } 031 f.setVisible(true); 032 } 033 private final static Logger log = LoggerFactory.getLogger(ReportAction.class); 034}