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 jul
- */
- public class frame extends JFrame{
- Button btn1 = new Button("SIGN IN");
- TextField textField = new TextField();
- JPasswordField passwordField = new JPasswordField();
- Label lbl_username = new Label("Username");
- Label lbl_password = new Label("Password");
- Label label_login = new Label("LOGIN");
- public frame() {
- super("sign In To APP");
- setSize(500, 300);
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- }
- public void Komponen(){
- setResizable(false);
- getContentPane().setLayout(null);
- getContentPane().setBackground(Color.GREEN);
- getContentPane().add(btn1);
- getContentPane().add(textField);
- getContentPane().add(passwordField);
- getContentPane().add(lbl_username);
- getContentPane().add(lbl_password);
- getContentPane().add(label_login);
- label_login.setBounds(50, 20, 200, 20);
- btn1.setBounds(10, 180, 100, 20);
- btn1.setBackground(Color.yellow);
- textField.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