Advertisement
Guest User

Untitled

a guest
Sep 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.19 KB | None | 0 0
  1. package ui;
  2.  
  3. import java.awt.EventQueue;
  4.  
  5. import javax.swing.JFrame;
  6. import java.awt.SystemColor;
  7. import javax.swing.JTextField;
  8. import javax.swing.JLabel;
  9. import javax.swing.JPasswordField;
  10. import javax.swing.SwingConstants;
  11. import java.awt.Font;
  12. import javax.swing.border.BevelBorder;
  13. import java.awt.Color;
  14. import java.awt.event.MouseAdapter;
  15. import java.awt.event.MouseEvent;
  16. import java.awt.Cursor;
  17.  
  18. public class Login extends JFrame {
  19.     private JTextField user;
  20.     private JPasswordField passwd;
  21.     private JLabel lblLogin;
  22.     private JTextField txtLogin;
  23.     private JTextField txtClose;
  24.     private JLabel lblNewLabel;
  25.     private JLabel lblPassword;
  26.     private JLabel Valid;
  27.  
  28.     /**
  29.      * Launch the application.
  30.      */
  31.     public static void main(String[] args) {
  32.         EventQueue.invokeLater(new Runnable() {
  33.             public void run() {
  34.                 try {
  35.                     Login frame = new Login();
  36.                     frame.setVisible(true);
  37.                 } catch (Exception e) {
  38.                     e.printStackTrace();
  39.                 }
  40.             }
  41.         });
  42.     }
  43.  
  44.     /**
  45.      * Create the frame.
  46.      */
  47.     public Login() {
  48.         getContentPane().setBackground(new Color(112, 128, 144));
  49.         getContentPane().setLayout(null);
  50.         private static long serialVersionUID
  51.         user = new JTextField();
  52.         user.setFont(new Font("Tahoma", Font.PLAIN, 15));
  53.         user.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
  54.         user.setColumns(10);
  55.         user.setBounds(155, 100, 314, 34);
  56.         getContentPane().add(user);
  57.        
  58.         passwd = new JPasswordField();
  59.         passwd.setFont(new Font("Tahoma", Font.PLAIN, 15));
  60.         passwd.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
  61.         passwd.setBounds(157, 156, 312, 34);
  62.         getContentPane().add(passwd);
  63.        
  64.         lblLogin = new JLabel("LOGIN");
  65.         lblLogin.setForeground(SystemColor.inactiveCaptionBorder);
  66.         lblLogin.setHorizontalAlignment(SwingConstants.CENTER);
  67.         lblLogin.setFont(new Font("Tahoma", Font.BOLD, 70));
  68.         lblLogin.setBounds(123, 25, 384, 55);
  69.         getContentPane().add(lblLogin);
  70.        
  71.         txtLogin = new JTextField();
  72.         txtLogin.addMouseListener(new MouseAdapter() {
  73.             public void mouseClicked(MouseEvent arg0) {
  74.             }
  75.         });
  76.         txtLogin.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  77.         txtLogin.setForeground(SystemColor.textHighlightText);
  78.         txtLogin.setFont(new Font("Tahoma", Font.BOLD, 15));
  79.         txtLogin.setHorizontalAlignment(SwingConstants.CENTER);
  80.         txtLogin.setText("LOGIN");
  81.         txtLogin.setBackground(SystemColor.textHighlightText);
  82.         txtLogin.setOpaque(false);
  83.         txtLogin.setEditable(false);
  84.         txtLogin.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));
  85.         txtLogin.setBounds(155, 227, 145, 40);
  86.         getContentPane().add(txtLogin);
  87.         txtLogin.setColumns(10);
  88.        
  89.         txtClose = new JTextField();
  90.         txtClose.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  91.         txtClose.addMouseListener(new MouseAdapter() {
  92.             public void mouseClicked(MouseEvent arg0) {
  93.                 dispose();
  94.             }
  95.         });
  96.         txtClose.setForeground(SystemColor.textHighlightText);
  97.         txtClose.setFont(new Font("Tahoma", Font.BOLD, 15));
  98.         txtClose.setHorizontalAlignment(SwingConstants.CENTER);
  99.         txtClose.setText("CLOSE");
  100.         txtClose.setBackground(SystemColor.textHighlightText);
  101.         txtClose.setOpaque(false);
  102.         txtClose.setEditable(false);
  103.         txtClose.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));
  104.         txtClose.setColumns(10);
  105.         txtClose.setBounds(324, 227, 145, 40);
  106.         getContentPane().add(txtClose);
  107.        
  108.         lblNewLabel = new JLabel("User");
  109.         lblNewLabel.setForeground(new Color(255, 255, 255));
  110.         lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
  111.         lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
  112.         lblNewLabel.setBounds(89, 100, 46, 34);
  113.         getContentPane().add(lblNewLabel);
  114.        
  115.         lblPassword = new JLabel("Password");
  116.         lblPassword.setForeground(new Color(255, 255, 255));
  117.         lblPassword.setFont(new Font("Tahoma", Font.PLAIN, 15));
  118.         lblPassword.setHorizontalAlignment(SwingConstants.CENTER);
  119.         lblPassword.setBounds(61, 156, 74, 34);
  120.         getContentPane().add(lblPassword);
  121.        
  122.         Valid = new JLabel("");
  123.         Valid.setBounds(167, 191, 87, 14);
  124.         getContentPane().add(Valid);
  125.         setBounds(400, 200, 629, 309);
  126.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  127.         setUndecorated(true);
  128.     }
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement