Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package edu;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import java.sql.*;
- public class Login implements ActionListener {
- JTextField username;
- JPasswordField pass;
- JPanel jp;
- JFrame jeff;
- JLabel l1, l2, l3;
- JButton button;
- Login(){
- try {
- Class.forName("org.mariadb.jdbc.Driver");
- Connection cn = DriverManager.getConnection("jdbc:mariadb://localhost:3306/syit","root","mariadb");
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- username = new JTextField(20);
- pass = new JPasswordField(20);
- l1 = new JLabel("Username");
- l2 = new JLabel("Password");
- l3 = new JLabel("");
- button = new JButton("Submit");
- jp = new JPanel();
- jp = new JPanel(new GridLayout(3, 2, 10, 10));
- jp.add(l1);
- jp.add(username);
- jp.add(l2);
- jp.add(pass);
- jp.add(l3);
- jp.add(button);
- jeff = new JFrame();
- jeff.add(jp);
- jeff.pack();
- jeff.setVisible(true);
- }
- public void actionPerformed(ActionEvent e) {
- }
- public static void main(String[] args) {
- new Login();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement