Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Taskbar.State;
import java.awt.Window.Type;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import java.sql.*;
public class Login extends JFrame {
private JPanel contentPanel;
private JTextField user;
private JPasswordField pass;
private JButton addButton;
private JButton updateButton;
private JButton deleteButton;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
Login login = new Login();
}
});
}
public Login() {
JFrame frame = new JFrame();
frame.setVisible(true);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.setBounds(100,100,250,250);
contentPanel= new JPanel();
contentPanel.setBorder(new EmptyBorder(5,5,5,5));
frame.setContentPane(contentPanel);
contentPanel.setLayout(null);
JLabel labelWelcome = new JLabel("Welcome");
labelWelcome.setBounds(10,10,200,45);
contentPanel.add(labelWelcome);
JLabel lblUsername = new JLabel("Username");
lblUsername.setBounds(20,64,62,14);
contentPanel.add(lblUsername);
user = new JTextField();
user.setBounds(10,78,198,28);
contentPanel.add(user);
user.setColumns(10);
JLabel lblPassword = new JLabel("Password");
lblPassword.setBounds(20,117,62,14);
contentPanel.add(lblPassword);
pass = new JPasswordField();
pass.setBounds(10,132,198,28);
contentPanel.add(pass);
JButton loginBtn = new JButton("Nevtreh");
loginBtn.addActionListener(new ActionListener() {
private JFrame frmLogin;
public void actionPerformed(ActionEvent e) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection con = DriverManager.getConnection
("jdbc:mysql://localhost:3306/pawn shop","root","");
Statement stmt = con.createStatement();
String sql = "SELECT * FROM users WHERE "
+ "username='"+user.getText()+"' AND password='"+pass.getText()+"'";
ResultSet rs = stmt.executeQuery(sql);
if(rs.next()) {
MainPage mp = new MainPage();
frame.dispose();
JOptionPane.showMessageDialog(null, "Login Successfully...");
}else {
JOptionPane.showMessageDialog(null, "Login failed...");
}
}catch (Exception ex){
System.out.print(ex);
}
}
});
loginBtn.setBounds(10,170,90,25);
contentPanel.add(loginBtn);
JButton regBtn = new JButton("Burtgel");
regBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Register rg = new Register();
}catch (Exception ex){
System.out.print(ex);
}
}
});
regBtn.setBounds(110,170,90,25);
contentPanel.add(regBtn);
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team