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