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.JLabel;
- import javax.swing.JTextField;
- import javax.swing.JPasswordField;
- import javax.swing.JMenuBar;
- import javax.swing.JButton;
- import java.awt.event.ActionListener;
- import java.awt.event.ActionEvent;
- import java.awt.CardLayout;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.SystemColor;
- import org.eclipse.wb.swing.FocusTraversalOnArray;
- import java.awt.Component;
- import javax.swing.JPanel;
- import javax.swing.border.BevelBorder;
- import javax.swing.DropMode;
- public class Database {
- private JFrame frame;
- private JFrame frame1;
- private JTextField textField;
- private JPasswordField passwordField;
- private JTextField textField_1;
- private JPanel panel;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- Database window = new Database();
- window.frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public Database() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- frame = new JFrame();
- frame.getContentPane().setForeground(SystemColor.activeCaption);
- frame.getContentPane().setBackground(Color.LIGHT_GRAY);
- frame.getContentPane().setFont(new Font("Tahoma", Font.BOLD, 13));
- frame.setBounds(100, 100, 450, 476);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.getContentPane().setLayout(null);
- /*frame1=new JFrame();
- frame1.getContentPane().setForeground(SystemColor.activeCaption);
- frame1.getContentPane().setBackground(Color.LIGHT_GRAY);
- frame1.getContentPane().setFont(new Font("Tahoma", Font.BOLD, 13));
- frame1.setBounds(100, 100, 450, 476);
- frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame1.getContentPane().setLayout(null);*/
- panel = new JPanel();
- panel.setBounds(0, 0, 544, 430);
- frame.getContentPane().add(panel);
- panel.setLayout(null);
- JPanel panel_1 = new JPanel();
- panel_1.setBounds(0, 0, 544, 430);
- panel.add(panel_1, "first");
- panel_1.setLayout(null);
- textField = new JTextField();
- textField.setBounds(154, 163, 126, 20);
- panel_1.add(textField);
- textField.setColumns(10);
- JLabel lblUsername = new JLabel("Username");
- lblUsername.setBounds(64, 166, 75, 14);
- lblUsername.setFont(new Font("Tahoma", Font.BOLD, 13));
- lblUsername.setBackground(Color.BLUE);
- panel_1.add(lblUsername);
- JLabel lblPassword = new JLabel("Password");
- lblPassword.setBounds(64, 197, 69, 14);
- lblPassword.setFont(new Font("Tahoma", Font.BOLD, 13));
- panel_1.add(lblPassword);
- passwordField = new JPasswordField();
- passwordField.setBounds(154, 194, 126, 20);
- panel_1.add(passwordField);
- JButton btnLogin = new JButton("login");
- btnLogin.setBounds(154, 249, 89, 23);
- btnLogin.setBackground(Color.ORANGE);
- panel_1.add(btnLogin);
- final JPanel panel_2 = new JPanel();
- panel_2.setBounds(318, 58, 89, 23);
- panel_1.add(panel_2,"second");
- panel_2.setLayout(null);
- JButton btnSignUp = new JButton("sign up");
- btnSignUp.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- // frame1.setVisible(true);
- // frame.setVisible(false);
- }
- });
- btnSignUp.setBounds(0, 0, 89, 23);
- panel_2.add(btnSignUp);
- btnSignUp.setFont(new Font("Tahoma", Font.BOLD, 13));
- btnSignUp.setBackground(Color.WHITE);
- JPanel panel_3 = new JPanel();
- panel_3.setBorder(new BevelBorder(BevelBorder.LOWERED, new Color(255, 0, 0), Color.RED, Color.RED, Color.RED));
- panel_3.setBounds(36, 107, 331, 215);
- panel_1.add(panel_3,"third");
- panel_3.setLayout(null);
- textField_1 = new JTextField();
- textField_1.setBounds(50, 184, 236, 20);
- textField_1.setEnabled(true);
- textField_1.setEditable(true);
- panel_3.add(textField_1);
- textField_1.setColumns(10);
- JLabel lblNewLabel = new JLabel("login");
- lblNewLabel.setBounds(149, 24, 46, 14);
- panel_3.add(lblNewLabel);
- panel.setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{textField, lblUsername, lblPassword, passwordField, btnLogin, btnSignUp}));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement