Friday, February 12, 2016

Program to add buttons in Frame.

import java.awt.*;
class btnAdd extends Frame
{
public static void main(String args[ ] )
{
Button b1=new Button("Add");
Button b2=new Button("Subtract");
Button b3=new Button("Mu|tip|y");
Button b4=new Button("Division");
btnAdd f1=new btnAdd();
f1 .setTitle("Adding Buttons in a Frame!!!");
f1 .setLayout(new FlowLayout());
f1 .add(b1 );
f1 .add(b2);
f1 .add(b3);
f1 .add(b4);
f1 .setSize(500,500);
f1 .setVisible(true );
}
}
Output:

No comments:

Post a Comment