Page 209 - CITS - CSA - TP (Volume 2) - Hindi
P. 209

कं  ूटर सॉ वेयर ए ीके शन - CITS




                   // Adding window close event handling

                   f.addWindowListener(new java.awt.event.WindowAdapter() {
                       public void windowClosing(java.awt.event.WindowEvent windowEvent) {
                           System.exit(0);
                       }

                   });
               }


               // main method
               public static void main(String args[]) {


                   // creating instance of TextExample class

                   TextExample awt_obj = new TextExample();
               }
           }


           आउटपुट:





























           टा  5: िसंपल आवेदन प  बनाना
              import java.awt.*;

              public class AwtApp extends Frame {
              AwtApp() {
                      Label firstName = new Label(“First Name”);

                      firstName.setBounds(20, 50, 80, 20);


                      Label lastName = new Label(“Last Name”);

                      lastName.setBounds(20, 80, 80, 20);


                                                           195

                                  CITS : IT & ITES - कं  ूटर सॉ वेयर ए ीके शन - अ ास 116
   204   205   206   207   208   209   210   211   212   213   214