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.*;
- /**
- *
- * @author ulul
- */
- public class frame extends JFrame{
- Button btn1 = new Button("Sign In");
- TextField txtField = new TextField();
- JPasswordField passwordField = new JPasswordField();
- Label lbl_username = new Label("Username");
- Label lbl_password = new Label("Password");
- Label label_login = new Label("Sign In To Start Your Session");
- public frame() {
- super("Sign In To APP");
- // setLocation(500,200);
- setSize(300,300);
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- }
- public void komponen(){
- setResizable(false);
- getContentPane().setLayout(null);
- getContentPane().setBackground(Color.PINK);
- getContentPane().add(btn1);
- getContentPane().add(txtField);
- getContentPane().add(passwordField);
- getContentPane().add(lbl_username);
- getContentPane().add(lbl_password);
- getContentPane().add(label_login);
- label_login.setBounds(50,20,200,20);
- btn1.setBounds(90, 130, 100, 20);
- btn1.setBackground(Color.blue);
- txtField.setBounds(90,70,100,20);
- passwordField.setBounds(90,100,100,20);
- lbl_username.setBounds(10,70,90,20);
- lbl_password.setBounds(10,100,90,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