HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML
 

"Multiplatform Frames"
Vol. 9, Issue 1, p. 44

	



Listing 1

1  class SDIFrame 
2         extends JFrame
3         implements IMultiEnvironFrame
4  {
5    // interface methods do not need
6    // to be specified--JFrame 
7    // provides these.  
8  }

1  class MDIFrame 
2         extends JInternalFrame
3         implements IMultiEnvironFrame
4  {
5    // Interface methods specific to
6    // JFrame are defined using 
7    // JInternalFrame method mappings.
8
9    public void setIconImage( 
       Image p_icon )
10   {
11     setFrameIcon( 
         new ImageIcon( p_icon ) );
13   } 
14
15   // ...
16 }

Listing 2

1  class ApplicationMenuGroup extends
   AbstractMenuGroup
2  {
3    // ...
4
5    // Very simple implementation.
6    public Object clone()
7    {
8      ApplicationMenuGroup newClone = 
         new ApplicationMenuGroup(); 
         // Could also use copy 
            constructor.
9      newClone.initMenus();
10     return newClone;
11   }
12
13   protected void initMenus()
14   {
15     JMenu fileMenu = 
         new JMenu("File");
17     addMenu( fileMenu );
18     // ...
19   }
20 }

 

All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: [email protected]

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.