home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / vpojava.DLL / SOURCE / APPLETFRAME < prev    next >
Text File  |  1998-03-18  |  2KB  |  65 lines

  1. /*
  2.     An extension of the java.awt.Frame class that can show an Applet
  3.  */
  4.  
  5. import java.awt.*;
  6. import java.applet.*;
  7.  
  8. public class AppletFrame extends symantec.itools.awt.AppletFrame
  9. {
  10.     public AppletFrame()
  11.     {
  12.         // This code is automatically generated by Visual Cafe when you add
  13.         // components to the visual environment. It instantiates and initializes
  14.         // the components. To modify the code, only use code syntax that matches
  15.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  16.         // parse your Java file into its visual environment.
  17.         //{{INIT_CONTROLS
  18.         //}}
  19.  
  20.         //{{INIT_MENUS
  21.         //}}
  22.  
  23.         //{{REGISTER_LISTENERS
  24.         //}}
  25.         show();
  26.     }
  27.  
  28.     public static void main(String args[])
  29.     {
  30.         new AppletFrame().show();
  31.     }
  32.  
  33.     public void addNotify()
  34.     {
  35.         // Record the size of the window prior to calling parents addNotify.
  36.         Dimension d = getSize();
  37.         
  38.         super.addNotify();
  39.  
  40.         if (fComponentsAdjusted)
  41.             return;
  42.  
  43.         // Adjust components according to the insets
  44.         setSize(insets().left + insets().right + d.width, insets().top + insets().bottom + d.height);
  45.         Component components[] = getComponents();
  46.         for (int i = 0; i < components.length; i++)
  47.         {
  48.             Point p = components[i].getLocation();
  49.             p.translate(insets().left, insets().top);
  50.             components[i].setLocation(p);
  51.         }
  52.         fComponentsAdjusted = true;
  53.     }
  54.  
  55.     // Used for addNotify check.
  56.     boolean fComponentsAdjusted = false;
  57.  
  58.     //{{DECLARE_CONTROLS
  59.     //}}
  60.  
  61.     //{{DECLARE_MENUS
  62.     //}}
  63.  
  64. }
  65.