Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package tugas_masjion;
- import java.awt.*;
- import javax.swing.JFrame;
- /**
- *
- * @author ulul
- */
- public class frame extends JFrame{
- Button btn1 = new Button("Kirim");
- TextField txtField = new TextField();
- Label lbl = new Label("Nama");
- public frame() {
- super("INI Frame");
- setLocation(500,200);
- setSize(275,290);
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- }
- public void komponen(){
- setResizable(false);
- getContentPane().setLayout(null);
- getContentPane().setBackground(Color.yellow);
- getContentPane().add(btn1);
- getContentPane().add(txtField);
- getContentPane().add(lbl);
- btn1.setBounds(50, 100, 100, 20);
- txtField.setBounds(50,80,100,20);
- lbl.setBounds(10,80,40,20);
- setVisible(true);
- }
- public static void main(String[] args) {
- frame obj = new frame();
- obj.komponen();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement