home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Samples / Samples / ActiveX / Calendar / Calendar.java < prev    next >
Encoding:
Java Source  |  2000-05-04  |  1.4 KB  |  52 lines

  1. //////////////////////////////////////////////////////////////////////////
  2. //
  3. //  Calendar.java
  4. //
  5. //      This example demonstrates the hosting of ActiveX controls within
  6. //      an applet.
  7. //
  8. //  (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  9. //
  10. //////////////////////////////////////////////////////////////////////////
  11.  
  12. import java.awt.*;                          // standard java
  13. import java.awt.event.*;
  14. import java.applet.*;
  15. import com.ms.ui.*;                         // afc controls
  16. import com.ms.activeX.*;                    // used for our control host
  17. import com.ms.com.*;                        // general com
  18.  
  19. public class Calendar extends Frame
  20. {
  21.     public static void main(String args[])
  22.     {
  23.         Calendar app = new Calendar();
  24.  
  25.         app.setSize(640, 480);
  26.         app.setVisible(true);
  27.     }
  28.  
  29.     Calendar()
  30.     {
  31.         ActiveXControl mscal = new ActiveXControl("{8E27C92B-1264-101C-8A2F-040224009C02}");
  32.         Button b          = new Button("Kung Foo Fighting");
  33.  
  34.         addWindowListener(new CalendarWindowListener() );
  35.  
  36.         this.setTitle("Calendar Example");
  37.         this.setBackground(Color.lightGray);
  38.  
  39.         setLayout(new BorderLayout());
  40.         add("Center", mscal);
  41.         add("North", b);
  42.     }
  43.  
  44.     class CalendarWindowListener extends WindowAdapter
  45.     {
  46.         public void windowClosing(WindowEvent e)
  47.         {
  48.                 System.exit(0);
  49.         }
  50.     }
  51. }
  52.