Advertisement
Guest User

iki

a guest
Oct 1st, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.68 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.*;  
  9.  
  10. /**
  11.  *
  12.  * @author ulul
  13.  */
  14.  
  15. public class frame extends JFrame{
  16.     Button btn1 = new Button("Sign In");
  17.     TextField txtField = new TextField();
  18.     JPasswordField passwordField = new JPasswordField();
  19.     Label lbl_username = new Label("Username");
  20.     Label lbl_password = new Label("Password");
  21.     Label label_login = new Label("Sign In To Start Your Session");
  22.     public frame() {
  23.         super("Sign In To APP");
  24.        // setLocation(500,200);
  25.         setSize(300,300);
  26.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  27.     }
  28.     public void komponen(){
  29.          setResizable(false);
  30.         getContentPane().setLayout(null);
  31.         getContentPane().setBackground(Color.PINK);
  32.         getContentPane().add(btn1);
  33.         getContentPane().add(txtField);
  34.          getContentPane().add(passwordField);
  35.         getContentPane().add(lbl_username);
  36.         getContentPane().add(lbl_password);
  37.         getContentPane().add(label_login);
  38.        
  39.         label_login.setBounds(50,20,200,20);
  40.         btn1.setBounds(90, 130, 100, 20);
  41.         btn1.setBackground(Color.blue);
  42.         txtField.setBounds(90,70,100,20);
  43.          
  44.         passwordField.setBounds(90,100,100,20);
  45.         lbl_username.setBounds(10,70,90,20);
  46.         lbl_password.setBounds(10,100,90,20);
  47.         setVisible(true);
  48.     }
  49.     public static void main(String[] args) {
  50.         frame obj = new frame();
  51.         obj.komponen();
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement