001         package com.croftsoft.core.gui;
002    
003         import java.awt.Dimension;
004         import java.awt.Frame;
005         import java.awt.event.WindowAdapter;
006         import java.awt.event.WindowEvent;
007         import java.io.IOException;
008         import javax.swing.JFrame;
009         import javax.swing.WindowConstants;
010    
011         import com.croftsoft.core.lang.ClassLib;
012         import com.croftsoft.core.lang.NullArgumentException;
013         import com.croftsoft.core.lang.lifecycle.Lifecycle;
014    
015         /*********************************************************************
016         * Library of static methods for manipulating Frame and JFrame objects.
017         *
018         * @version
019         *   2002-12-24
020         * @since
021         *   2002-02-16
022         * @author
023         *   <a href="https://www.croftsoft.com/">David Wallace Croft</a>
024         *********************************************************************/
025    
026         public final class  FrameLib
027         //////////////////////////////////////////////////////////////////////
028         //////////////////////////////////////////////////////////////////////
029         {
030    
031         /*********************************************************************
032         * Associates a LifecycleWindowListener with the JFrame and launches.
033         *
034         * @deprecated
035         *
036         *   This method has been moved to class LifecycleWindowListener.
037         *********************************************************************/
038         public static void  launchJFrameAsDesktopApp (
039           JFrame               jFrame,
040           final Lifecycle [ ]  lifecycles,
041           Dimension            frameSize,
042           String               shutdownConfirmationPrompt )
043         //////////////////////////////////////////////////////////////////////
044         {
045           LifecycleWindowListener.launchFrameAsDesktopApp (
046             jFrame, lifecycles, frameSize, shutdownConfirmationPrompt );
047         }
048    
049         public static void  setIconImage (
050           Frame   frame,
051           String  iconImageFilename )
052           throws IOException
053         //////////////////////////////////////////////////////////////////////
054         {
055           frame.setIconImage ( ClassLib.getResourceAsImage (
056               FrameLib.class, iconImageFilename ) );
057         }
058    
059         //////////////////////////////////////////////////////////////////////
060         //////////////////////////////////////////////////////////////////////
061    
062         private  FrameLib ( ) { }
063    
064         //////////////////////////////////////////////////////////////////////
065         //////////////////////////////////////////////////////////////////////
066         }