Saturday, 9 September 2017

Applet program for button

import java.awt.*;
import java.applet.*;
/*<applet code=butt height=500 width=500></applet>*/
public class butt extends Applet
{
    Button b1,b2;
    public void init()
    {
       setLayout(new FlowLayout(FlowLayout.RIGHT));
        b1=new Button("ok");
        b1.setFont(new Font("gothic",Font.BOLD,23));
        b1.setBackground(Color.green);
        b2=new Button("cancel");
         b2.setEnabled(false);
        add(b1);//it is the method of Container class
        add(b2);
   }
}       

No comments:

Post a Comment

Featured post

Development Of JAVA Program