Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

COMPLEX LAYOUT

DI
S
U
S
U
N
Oleh:
Idris Salamus Rizal
131020120023

PROGRAM STUDI TEKNIK INFORMATIKA


FAKULTAS ILMU KOMPUTER
UNIVERSITAS UBUDIYAH INDONESIA
BANDA ACEH

//PROGRAM BY IDRIS SALAMUS RIZAL


import java.awt.*;
public class ComplexLayout extends Frame{
public ComplexLayout() {
setBackground(Color.green);
}
public static void main (String args[]) {
ComplexLayout cl = new ComplexLayout();
Panel panelNorth = new Panel();
Panel panelCenter = new Panel();
Panel panelSouth = new Panel();
panelNorth.add(new Button ("U"));
panelNorth.add(new Button ("U"));
panelNorth.add(new Button ("I"));
panelNorth.setBackground(Color.blue);
panelCenter.setLayout (new GridLayout (4,4));
panelCenter.add(new TextField ("Hello World"));
panelCenter.add(new TextField ("Name : Idris Salamus
Rzal"));
panelCenter.add(new TextField ("NIM
:
131020120023"));
panelCenter.add(new TextField ("Prodi : Teknik
Informatika"));
panelCenter.setFont(new Font
("Calibri",Font.PLAIN,15));
panelSouth.setLayout (new BorderLayout());
panelSouth.add(new Checkbox ("Choose
me!"),BorderLayout.CENTER);
panelSouth.add(new Checkbox("i'm
here!"),BorderLayout.EAST);
panelSouth.add(new Checkbox("Pick
me!"),BorderLayout.WEST);
panelSouth.setBackground(Color.red);
cl.add(panelNorth,BorderLayout.NORTH);
cl.add(panelCenter,BorderLayout.CENTER);
cl.add(panelSouth,BorderLayout.SOUTH);
cl.setSize(300,500);
cl.setVisible(true);
}
}

You might also like