Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Conversation opened. 1 unread message.
- Skip to content
- Using Gmail with screen readers
- Click here to enable desktop notifications for Gmail. Learn more Hide
- 1 of 378
- Java Login Form
- Inbox
- x
- Aman Chaturvedi <dmrnigdi@gmail.com>
- 7:01 PM (19 minutes ago)
- to me
- package Lightapp;
- import java.sql.* ;
- import javax.swing.* ;
- public class AbbeyLog extends javax.swing.JFrame
- {
- Connection conn = null;
- ResultSet rs = null;
- PreparedStatement pst = null;
- /**
- * Creates new form AbbeyLog
- */
- public AbbeyLog()
- {
- initComponents();
- }
- @SuppressWarnings("unchecked")
- private void textuserActionPerformed(java.awt.event.ActionEvent evt)
- {
- // TODO add your handling code here:
- String sql = "select * from login where username = ? and password = ?";
- try
- {
- pst = conn.prepareStatement(sql);
- pst.setString(1, textuser.getText());
- pst.setString(2, textpass.getText());
- rs = pst.executeQuery();
- if (rs.next())
- {
- JOptionPane.showMessageDialog(null, "Username and Password correct");
- }
- else
- {
- JOptionPane.showMessageDialog(null, "invalid username and password");
- }
- }
- catch (Exception e)
- {
- JOptionPane.showMessageDialog(null, e);
- }
- }
- private void textuserMouseClicked(java.awt.event.MouseEvent evt)
- {
- // TODO add your handling code here:
- }
- public static void main(String args[])
- {
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable()
- {
- public void run()
- {
- new AbbeyLog().setVisible(true);
- }
- });
- }
- // Variables declaration - do not modify
- private javax.swing.JButton jButton2;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel2;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JPanel jPanel2;
- private javax.swing.JTextField jTextField1;
- private javax.swing.JTextField textpass;
- private javax.swing.JButton textuser;
- // End of variables declaration
- }
- Click here to Reply or Forward
- 2.3 GB (15%) of 15 GB used
- Manage
- Terms - Privacy
- Last account activity: 19 minutes ago
- Details
Add Comment
Please, Sign In to add comment