Tuesday, 14 February 2017

How to use java code for grid program


#  Grid Demo Program



//***********************Start********************

import java.awt.*;
public class grid extends Frame {

    Button b1, b2, b3, b4,b5,b6;
    public grid() {
        setLayout(new GridLayout(3,2,5,5));
        b1 = new Button("b1");
        b2 = new Button("b2");
        b3 = new Button("b3");
        b4 = new Button("b4");
        b5 = new Button("b5");
        b6 = new Button("b6");
     
        add(b1);
        add(b2);
        add(b3);
        add(b4);
        add(b5);
        add(b6);

pack();
 setVisible(true);
   
    }
    public static void main(String arsg[]) {
        grid obj = new grid();
    }
 
}
//*************************End*****************************

No comments:

Post a Comment

Welcome, happy learning

Charactor_At_Position

public class Char_At_Position { public static void main(String[] args) { String str = "Wankhede"; String rev=""...