Advertisement
Guest User

tuagas LOGIN Muh.Julkarnain

a guest
Oct 11th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 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.  
  7. package tugas_masjion;
  8. import java.awt.*;
  9. import javax.swing.*;
  10.  
  11. /**
  12.  *
  13.  * @author jul
  14.  */
  15. public class frame extends JFrame{
  16.     Button btn1 = new Button("SIGN IN");
  17.     TextField textField = 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("LOGIN");
  22.     public  frame() {
  23.          super("sign In To APP");
  24.          setSize(500, 300);
  25.          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  26.     }
  27.     public void Komponen(){
  28.         setResizable(false);
  29.         getContentPane().setLayout(null);
  30.         getContentPane().setBackground(Color.GREEN);
  31.         getContentPane().add(btn1);
  32.         getContentPane().add(textField);
  33.         getContentPane().add(passwordField);
  34.         getContentPane().add(lbl_username);
  35.         getContentPane().add(lbl_password);
  36.         getContentPane().add(label_login);
  37.        
  38.         label_login.setBounds(50, 20, 200, 20);
  39.         btn1.setBounds(10, 180, 100, 20);
  40.         btn1.setBackground(Color.yellow);
  41.         textField.setBounds(90, 70, 100, 20);
  42.        
  43.         passwordField.setBounds(90, 100, 100, 20);
  44.         lbl_username.setBounds(10, 70, 90, 20);
  45.         lbl_password.setBounds(10, 100, 90, 20);
  46.         setVisible(true);
  47.     }
  48.     public static void main(String[] args) {
  49.         frame obj = new frame();
  50.         obj.Komponen();
  51.    
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement