001package jmri.jmrit.operations.setup; 002 003import java.awt.Frame; 004import java.awt.event.ActionEvent; 005 006import javax.swing.AbstractAction; 007 008/** 009 * Swing action to load the print options. 010 * 011 * @author Bob Jacobsen Copyright (C) 2001 012 * @author Daniel Boudreau Copyright (C) 2009 013 */ 014public class PrintOptionAction extends AbstractAction { 015 016 public PrintOptionAction() { 017 super(Bundle.getMessage("TitlePrintOptions")); 018 } 019 020 PrintOptionFrame f = null; 021 022 @Override 023 public void actionPerformed(ActionEvent e) { 024 if (f == null || !f.isVisible()) { 025 f = new PrintOptionFrame(); 026 f.initComponents(); 027 } 028 f.setExtendedState(Frame.NORMAL); 029 f.setVisible(true); // this also brings the frame into focus 030 } 031} 032 033