Write a program to define a Frame.
      · Set 100 Buttons array into it.
      · Set the size of a frame as (400,400)
      · Set the visibility as true
      · Set a FlowLayout as Left
      · And add those hundred buttons into the frame
import java.awt.*;
import java.awt.event.*;
class Layout1 extends Frame
{
    int i;
    char ch;
    Button b1[] = new Button[100];
    Layout1()
    {
        setSize(400,400);
        setVisible(true);
        FlowLayout f1 = new FlowLayout(FlowLayout.LEFT);
        setLayout(f1);
        for(i=0;i<100;i++)
        {
            ch = (char) i;
            b1[i] = new Button(""+i);
            add(b1[i]);
        }
    }
    public static void main(String args[])
    {
        new Layout1();   
    }   
}

0 comments:

Post a Comment

Digital Marketing

Subscribe to RSS Feed Follow me on Twitter!