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.JPanel;
- import javax.swing.border.EmptyBorder;
- import javax.swing.JLabel;
- import java.awt.Font;
- import java.awt.event.ActionListener;
- import javax.swing.JTextField;
- import javax.swing.JPasswordField;
- import javax.swing.JComboBox;
- import javax.swing.JButton;
- import javax.swing.DefaultComboBoxModel;
- import java.awt.event.ActionEvent;
- public class Login extends JFrame {
- private JPanel contentPane;
- private JTextField User;
- private JPasswordField Pass;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- Login frame = new Login();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the frame.
- */
- public Login() {
- setResizable(false);
- setType(Type.UTILITY);
- setTitle("MMG-Aklan Pharmacy Sales & Inventory System");
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 425, 199);
- contentPane = new JPanel();
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- contentPane.setLayout(null);
- JLabel Title = new JLabel("Login");
- Title.setBounds(175, 11, 116, 25);
- Title.setFont(new Font("Tahoma", Font.BOLD, 20));
- contentPane.add(Title);
- JLabel UserL = new JLabel("Username:");
- UserL.setFont(new Font("Tahoma", Font.PLAIN, 16));
- UserL.setBounds(10, 48, 83, 14);
- contentPane.add(UserL);
- JLabel PassL = new JLabel("Password:");
- PassL.setFont(new Font("Tahoma", Font.PLAIN, 16));
- PassL.setBounds(10, 95, 83, 14);
- contentPane.add(PassL);
- User = new JTextField();
- User.setColumns(10);
- User.setBounds(103, 47, 109, 20);
- contentPane.add(User);
- Pass = new JPasswordField();
- Pass.setBounds(103, 94, 109, 20);
- contentPane.add(Pass);
- JComboBox Down = new JComboBox();
- Down.setModel(new DefaultComboBoxModel(new String[] {"Cashier", "Manager", "Admin"}));
- Down.setMaximumRowCount(3);
- Down.setFont(new Font("Tahoma", Font.BOLD, 15));
- Down.setBounds(236, 45, 161, 20);
- contentPane.add(Down);
- JButton Login = new JButton("Login");
- Login.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- }
- });
- Login.setFont(new Font("Tahoma", Font.BOLD, 11));
- Login.setBounds(236, 92, 76, 25);
- contentPane.add(Login);
- /**
- **/
- JButton Cancel = new JButton("Cancel");
- Cancel.setFont(new Font("Tahoma", Font.BOLD, 11));
- Cancel.setBounds(320, 93, 77, 23);
- contentPane.add(Cancel);
- Cancel.addActionListener(new CloseListener());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement