1 5 package net.sf.panoptes.controller.actions; 6 7 import java.awt.Image ; 8 import java.awt.event.ActionEvent ; 9 import java.awt.image.BufferedImage ; 10 11 import javax.swing.AbstractAction ; 12 import javax.swing.Action ; 13 import javax.swing.Icon ; 14 import javax.swing.ImageIcon ; 15 import javax.swing.JFrame ; 16 import javax.swing.JInternalFrame ; 17 18 import org.apache.commons.logging.Log; 19 import org.apache.commons.logging.LogFactory; 20 21 27 public class ExternalizeFrameAction extends BaseAction { 28 protected Log log = LogFactory.getLog(getClass()); 29 JInternalFrame frame; 30 public ExternalizeFrameAction(JInternalFrame frame) { 31 super("Externalize"); 32 this.frame = frame; 33 putValue(Action.SHORT_DESCRIPTION, "Externalize this frame"); 34 } 35 36 public void actionPerformed(ActionEvent e) { 37 JFrame newFrame = new JFrame (frame.getTitle()); 38 newFrame.setContentPane(frame.getContentPane()); 39 frame.setVisible(false); 40 newFrame.getContentPane().doLayout(); 41 newFrame.pack(); 42 newFrame.show(); 43 } 44 45 } 46 | Popular Tags |