SHARE
TWEET

why

a guest Feb 14th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Eseguibile;
  2.  
  3. import javax.swing.JFrame;
  4. import javax.swing.SpringLayout;
  5. import javax.swing.JLabel;
  6. import java.awt.Font;
  7. import javax.swing.SwingConstants;
  8. import javax.swing.JTextField;
  9. import javax.swing.JPasswordField;
  10. import javax.swing.JButton;
  11.  
  12. public class FrameMain {
  13.  
  14.     JFrame finestra;
  15.     private JTextField textField;
  16.     private JPasswordField passwordField;
  17.    
  18.     public FrameMain() {
  19.         finestra = new JFrame();
  20.         finestra.getContentPane().setLayout(null);
  21.        
  22.         JLabel lbl_username = new JLabel("Username");
  23.         lbl_username.setHorizontalAlignment(SwingConstants.CENTER);
  24.         lbl_username.setLabelFor(lbl_username);
  25.         lbl_username.setBounds(0, 11, 132, 36);
  26.         lbl_username.setFont(new Font("Verdana", Font.PLAIN, 17));
  27.         finestra.getContentPane().add(lbl_username);
  28.        
  29.         JLabel lblPassword = new JLabel("Password");
  30.         lblPassword.setHorizontalAlignment(SwingConstants.CENTER);
  31.         lblPassword.setFont(new Font("Verdana", Font.PLAIN, 17));
  32.         lblPassword.setBounds(0, 47, 122, 27);
  33.         finestra.getContentPane().add(lblPassword);
  34.        
  35.         textField = new JTextField();
  36.         textField.setBounds(142, 22, 132, 20);
  37.         finestra.getContentPane().add(textField);
  38.         textField.setColumns(10);
  39.        
  40.         passwordField = new JPasswordField();
  41.         passwordField.setBounds(142, 53, 132, 20);
  42.         finestra.getContentPane().add(passwordField);
  43.        
  44.         JButton btnNewButton = new JButton("Accedi");
  45.         btnNewButton.setBounds(142, 84, 132, 23);
  46.         finestra.getContentPane().add(btnNewButton);
  47.        
  48.     }
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top