public static void main(String[] args) {
Label lblA, lblB, lblC,lblKetQua;
TextField txtA, txtB, txtC;
Button btnGiai, btnLamLai, btnThoat;
Frame fr = new Frame("Ax^2 + Bx + C =0");
lblA = new Label("A");
lblB = new Label("B");
lblC = new Label("C");
txtA = new TextField();
txtB = new TextField();
txtC = new TextField();
lblKetQua= new Label("ghi ket qua");
btnGiai = new Button("Giai");
btnLamLai= new Button("Lam lai");
btnThoat = new Button("Thoat");
fr.setBounds(100, 200, 300, 300);// ngang, doc, rong , cao
int cao = 30;
fr.setLayout(null);
lblA.setBounds(50, 50, 50, cao);
lblB.setBounds(50, 50 + cao + 10, 50, cao);
lblC.setBounds(50, 110+ cao, 50, cao);
txtA.setBounds(100, 50, 100, cao);
txtB.setBounds(100, 50 + cao + 10, 100, cao);
txtC.setBounds(100, 110+ cao, 100, cao);
fr.add(lblA);
fr.add(lblB);
fr.add(lblC);
fr.add(txtA);
fr.add(txtB);
fr.add(txtC);
lblKetQua.setBounds(50,150+cao, 250, cao);
btnGiai.setBounds(50,220, 50, cao);
btnLamLai.setBounds(110,220, 50, cao);
btnThoat.setBounds(170,220, 50, cao);
fr.add(btnGiai);
fr.add(btnLamLai);
fr.add(btnThoat);
fr.add(lblKetQua);
fr.setResizable(false);
fr.setVisible(true);
}
}