Advertisement
Guest User

gui

a guest
Sep 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package tugas_masjion;
  7. import java.awt.*;
  8. import javax.swing.JFrame;
  9.  
  10. /**
  11.  *
  12.  * @author ulul
  13.  */
  14.  
  15. public class frame extends JFrame{
  16.     Button btn1 = new Button("Kirim");
  17.     TextField txtField = new TextField();
  18.     Label lbl = new Label("Nama");
  19.     public frame() {
  20.         super("INI Frame");
  21.         setLocation(500,200);
  22.         setSize(275,290);
  23.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  24.     }
  25.     public void komponen(){
  26.          setResizable(false);
  27.         getContentPane().setLayout(null);
  28.         getContentPane().setBackground(Color.yellow);
  29.         getContentPane().add(btn1);
  30.         getContentPane().add(txtField);
  31.         getContentPane().add(lbl);
  32.         btn1.setBounds(50, 100, 100, 20);
  33.        
  34.         txtField.setBounds(50,80,100,20);
  35.         lbl.setBounds(10,80,40,20);
  36.         setVisible(true);
  37.     }
  38.     public static void main(String[] args) {
  39.         frame obj = new frame();
  40.         obj.komponen();
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement