Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.*;
- public class swing extends JFrame{
- JButton signup,login;
- Label text,textusername,textpassword;
- JTextField username;
- JPasswordField password;
- public void cobaSwing(){
- setTitle("cobaTitle");
- signup = new JButton("Sign Up");
- login = new JButton("Login");
- text = new Label("Login");
- textusername = new Label("Username");
- textpassword = new Label("Password");
- username = new JTextField();
- password = new JPasswordField();
- setLayout(null);
- add(signup);
- add(login);
- add(text);
- add(textusername);
- add(textpassword);
- add(username);
- add (password);
- textusername.setBounds (50,50,100,30);
- username.setBounds (160,55,100,20);
- textpassword.setBounds (50,90,100,30);
- password.setBounds (160,95,100,20);
- text.setBounds (130,10,80,30);
- signup.setBounds(50,150,80,30);
- login.setBounds(180,150,80,30);
- pack();
- setSize(325,250);
- setVisible(true);
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement