Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.EventQueue;
- import javax.swing.JFrame;
- import javax.swing.JInternalFrame;
- import java.awt.BorderLayout;
- import javax.swing.JPanel;
- import java.awt.Color;
- import java.awt.FlowLayout;
- import javax.swing.JLabel;
- import javax.swing.JTextField;
- import javax.swing.JPasswordField;
- import javax.swing.JButton;
- import java.awt.event.ActionListener;
- import java.awt.event.ActionEvent;
- import javax.swing.SwingConstants;
- public class Login {
- private JFrame frame;
- private JTextField txtUsername;
- private JPasswordField pwdPassword;
- private JButton btnNewButton_1;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- Login window = new Login();
- window.frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public Login() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- frame = new JFrame();
- frame.setBounds(100, 100, 484, 354);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.getContentPane().setLayout(null);
- JPanel panel = new JPanel();
- panel.setBackground(Color.GRAY);
- panel.setBounds(56, 48, 367, 207);
- frame.getContentPane().add(panel);
- panel.setLayout(null);
- txtUsername = new JTextField();
- txtUsername.setToolTipText("hi\r\n");
- txtUsername.setHorizontalAlignment(SwingConstants.LEFT);
- txtUsername.setText("Username");
- txtUsername.setBounds(80, 49, 233, 20);
- panel.add(txtUsername);
- txtUsername.setColumns(10);
- pwdPassword = new JPasswordField();
- pwdPassword.setText("Password");
- pwdPassword.setBounds(80, 80, 233, 20);
- panel.add(pwdPassword);
- JButton btnNewButton = new JButton("Login");
- btnNewButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- }
- });
- btnNewButton.setBounds(80, 111, 233, 20);
- panel.add(btnNewButton);
- btnNewButton_1 = new JButton("Create new user");
- btnNewButton_1.setBounds(80, 142, 233, 20);
- panel.add(btnNewButton_1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement