Sunday, May 26, 2013

Applet in Java

HTML FILE CODE:

Create a file name sample.html and write the following code in it.

<applet code="app1"width=600 height=600></applet>


Then create a java file and write the following code in it.


import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class app1 extends Applet implements ActionListener
 {
   
    Button b;
    TextField t;

      public void Init()
{
   b=new Button("CLICK:");
                t=new TextField(20);

          setLayout(new FlowLayout());

             add(b);    add(t);

              b.addActionListener(this);
         }

         public void actionPerformed(ActionEvent ae)
               {
                   if(ae.getSource()==b)
                      {
                          t.setText("YOUR NAME HERE:");
                      }
               }

         
     }

 
              

No comments:

Post a Comment

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...