Membuat Frame pada semua jenis
Layout
import java.awt.*;
import javax.swing.*;
class MacamLayout extends JFrame{
JButton N0,B1, B2, B3, B4,B5, B6, B7, B8, B9,
B10, B11 ;
JLabel lNama,lNama2,lNama3;
JPanel P1,P2,P3;
public MacamLayout() {
setTitle("MULTI LAYOUT");
JLabel lNama= new JLabel("Flow
Layout" );
JButton B0=new JButton ("0");
JButton B1=new JButton ("1");
JButton B2=new JButton ("2");
JButton B3=new JButton ("3");
JLabel lNama2= new JLabel("None
Layout" );
JButton B4=new JButton ("4");
JButton B5=new JButton ("5");
JButton B6=new JButton ("6");
JButton B7=new JButton ("7");
JLabel lNama3= new JLabel("Grid
Layout" );
JButton B8=new JButton ("8");
JButton B9=new JButton ("9");
JButton B10=new JButton ("10");
JButton B11=new JButton ("11");
P1 = new JPanel();
P2 = new JPanel();
P3 = new JPanel();
setLayout(null);
add(lNama);
add(lNama2);
add(lNama3);
add(P1);
add(P2);
add(P3);
lNama.setBounds(15,10,100,20);
lNama2.setBounds(220,10,100,20);
lNama3.setBounds(320,10,100,20);
P1.setBounds(5,30,200,40);
P2.setBounds(215,30,200,100);
P3.setBounds(320,30,200,150);
P1.setLayout(new FlowLayout());
P1.add(B0);
P1.add(B1);
P1.add(B2);
P1.add(B3);
P2.setLayout(null);
P2.add(B4);
P2.add(B5);
P2.add(B6);
P2.add(B7);
B4.setBounds(5,10,70,20);
B5.setBounds(5,30,70,20);
B6.setBounds(5,50,70,20);
B7.setBounds(5,70,70,20);
P3.setLayout(new GridLayout(2,2));
P3.add(B8);
P3.add(B9);
P3.add(B10);
P3.add(B11);
P3.setSize(100,100);
setSize(450,180);
setVisible(true);
setDefaultCloseOperation(3);
}
}
public
class TUGAS2 {
public
static void main(String[] args) {
MacamLayout
l= new MacamLayout();
}
}
Output :
Why casinos are rigged - Hertzaman - The Herald
BalasHapusIn 바카라 사이트 the UK, casino games are rigged and there 1xbet 먹튀 is evidence of fraud, crime 바카라 사이트 or disorder or an individual's involvement. There are also many 출장안마