import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class cobaSwing{
JFrame mainFrame;
JPanel pnl;
JButton tombol;
JLabel label;
public cobaSwing(){
mainFrame = new JFrame("Good Coba Swing");
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setSize(300,200);
pnl = new JPanel();
label = new JLabel("Coba Swing");
tombol = new JButton("Tombol1");
pnl.add(label);
pnl.add(tombol);
mainFrame.add(pnl);
}
public static void main(String[] args){
cobaSwing mf = new cobaSwing();
mf.mainFrame.setVisible(true);
}
}