import java.awt.*;
import javax.swing.*;
class kuis2 extends Frame {
public static void main ( String [] args ) {
Frame fr =new Frame("Tes Visual 2");
Panel panel1 = new Panel();
Panel panel2 = new Panel();
Panel panel3 = new Panel();
Panel panel4 = new Panel();
panel1.setLayout(new FlowLayout(FlowLayout.CENTER));
Label lb=new Label("Contoh Penggunaan Label");
panel1.add(lb);
panel2.setLayout(new FlowLayout(FlowLayout.LEFT));
TextField tf1 = new TextField ("Text 1");
TextField tf2 = new TextField ("Text 2");
panel2.add(tf1);
panel2.add(tf2);
panel3.setLayout(new GridLayout(3,1));
JRadioButton cb1= new JRadioButton("Check 1");
JRadioButton cb2= new JRadioButton("Check 2");
JRadioButton cb3= new JRadioButton("Check 3");
panel3.add(cb1);
panel3.add(cb2);
panel3.add(cb3);
panel4.setLayout(new FlowLayout());
Button bt1= new Button("I Accept");
Button bt2=new Button("I don't Accept");
Button bt3 = new Button("Help");
panel4.add(bt1);
panel4.add(bt2);
panel4.add(bt3);
fr.add(panel1,BorderLayout.NORTH);
fr.add(panel2, BorderLayout.WEST);
fr.add(panel3,BorderLayout.EAST);
fr.add(panel4, BorderLayout.SOUTH);
fr.setSize(300,400);
fr.setVisible(true);
} }
import javax.swing.*;
class kuis2 extends Frame {
public static void main ( String [] args ) {
Frame fr =new Frame("Tes Visual 2");
Panel panel1 = new Panel();
Panel panel2 = new Panel();
Panel panel3 = new Panel();
Panel panel4 = new Panel();
panel1.setLayout(new FlowLayout(FlowLayout.CENTER));
Label lb=new Label("Contoh Penggunaan Label");
panel1.add(lb);
panel2.setLayout(new FlowLayout(FlowLayout.LEFT));
TextField tf1 = new TextField ("Text 1");
TextField tf2 = new TextField ("Text 2");
panel2.add(tf1);
panel2.add(tf2);
panel3.setLayout(new GridLayout(3,1));
JRadioButton cb1= new JRadioButton("Check 1");
JRadioButton cb2= new JRadioButton("Check 2");
JRadioButton cb3= new JRadioButton("Check 3");
panel3.add(cb1);
panel3.add(cb2);
panel3.add(cb3);
panel4.setLayout(new FlowLayout());
Button bt1= new Button("I Accept");
Button bt2=new Button("I don't Accept");
Button bt3 = new Button("Help");
panel4.add(bt1);
panel4.add(bt2);
panel4.add(bt3);
fr.add(panel1,BorderLayout.NORTH);
fr.add(panel2, BorderLayout.WEST);
fr.add(panel3,BorderLayout.EAST);
fr.add(panel4, BorderLayout.SOUTH);
fr.setSize(300,400);
fr.setVisible(true);
} }
0 komentar:
Posting Komentar