Ajp Exp 2
Ajp Exp 2
import java.awt.*;
BorderLayoutex(){
add(b1,b.NORTH);
add(b2,b.SOUTH);
add(b3,b.EAST);
add(b4,b.WEST);
add(ll,b.CENTER);
setSize(800,800);
setVisible(true);
}}
Output:-
Grid Layout
import java.awt.*;
GridLayoutex() {
setLayout(gl);
add(l);
add(t);
add(l2);
t2.setEchoChar('*');
add(t2);
add(b);
setSize(800,800);
setVisible(true);
}}
Output:-
Grid Layout 5x5
import java.awt.*;
class GridLayout5x5 extends Frame
{
GridLayout5x5()
{
GridLayout gl = new GridLayout(5,5);
setLayout(gl);
Button b = new Button("Button 1");
add(b);
Button b2 = new Button("Button 2");
add(b2);
Button b3 = new Button("Button 3");
add(b3);
Button b4 = new Button("Button 4");
add(b4);
Button b5 = new Button("Button 5");
add(b5);
Button b6 = new Button("Button 6");
add(b6);
Button b7 = new Button("Button 7");
add(b7);
Button b8 = new Button("Button 8");
add(b8);
Button b9 = new Button("Button 9");
add(b9);
Button b10 = new Button("Button 10");
add(b10);
Button b11 = new Button("Button 11");
add(b11);
Button b12 = new Button("Button 12");
add(b12);
Button b13 = new Button("Button 13");
add(b13);
Button b14 = new Button("Button 14");
add(b14);
Button b15 = new Button("Button 15");
add(b15);
Button b16 = new Button("Button 16");
add(b16);
Button b17 = new Button("Button 17");
add(b17);
Button b18 = new Button("Button 18");
add(b18);
Button b19 = new Button("Button 19");
add(b19);
Button b20 = new Button("Button 20");
add(b20);
Button b21 = new Button("Button 21");
add(b21);
Button b22 = new Button("Button 22");
add(b22);
Button b23 = new Button("Button 23");
add(b23);
Button b24 = new Button("Button 24");
add(b24);
Button b25 = new Button("Button 25");
add(b25);
setSize(1000,800);
setVisible(true);
}
public static void main(String args[])
{
GridLayout5x5 gg = new GridLayout5x5();
}
}
Output:-
import java.awt.*;
class GridLayoutbutton extends Frame
{ GridLayoutbutton() {
GridLayout gl = new GridLayout(2,2,30,30);
setLayout(gl);
Button b1 = new Button("Button 1");
add(b1);
Button b2 = new Button("Button 2");
add(b2);
Button b3 = new Button("Button 3");
add(b3);
Button b4 = new Button("Button 4");
add(b4);
setSize(500,500);
setVisible(true);
} public static void main(String args[]) {
GridLayoutbutton gg = new GridLayoutbutton();
}}