Delete oknoPIN.java
This commit is contained in:
parent
aec11addb2
commit
3c599a09b1
@ -1,121 +0,0 @@
|
||||
import java.awt.EventQueue;
|
||||
//import java.awt.Toolkit;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import java.awt.Color;
|
||||
import javax.swing.SwingConstants;
|
||||
//import javax.swing.BoxLayout;
|
||||
//import javax.swing.JTree;
|
||||
//import javax.swing.JSlider;
|
||||
//import javax.swing.JToggleButton;
|
||||
//import com.jgoodies.forms.layout.FormLayout;
|
||||
//import com.jgoodies.forms.layout.ColumnSpec;
|
||||
//import com.jgoodies.forms.layout.RowSpec;
|
||||
//import com.jgoodies.forms.layout.FormSpecs;
|
||||
//import javax.swing.JTextField;
|
||||
import javax.swing.JPasswordField;
|
||||
import javax.swing.JButton;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.Font;
|
||||
|
||||
|
||||
public class oknoPIN extends StolowkaZPM {
|
||||
|
||||
private JFrame PodajPin;
|
||||
private JPasswordField passwordField;
|
||||
|
||||
public static void noweOkno() {
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
oknoPIN window = new oknoPIN();
|
||||
window.PodajPin.setVisible(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Connection conn=null;
|
||||
|
||||
public oknoPIN () {
|
||||
initialize2();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the contents of the frame.
|
||||
*/
|
||||
private void initialize2 () {
|
||||
//**************************************
|
||||
conn=SQLiteConnection.dbConnector();
|
||||
//**************************************
|
||||
PodajPin = new JFrame();
|
||||
PodajPin.setTitle("Podaj PIN");
|
||||
PodajPin.setBounds(100, 100, 528, 306);
|
||||
PodajPin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
PodajPin.getContentPane().setLayout(null);
|
||||
PodajPin.setSize(1700, 600);
|
||||
|
||||
JLabel lblOknoPin = new JLabel("Podaj sw\u00F3j PIN");
|
||||
lblOknoPin.setFont(new Font("Tahoma", Font.PLAIN, 56));
|
||||
lblOknoPin.setBounds(608, 128, 440, 58);
|
||||
lblOknoPin.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
lblOknoPin.setBackground(Color.YELLOW);
|
||||
lblOknoPin.setForeground(Color.BLUE);
|
||||
PodajPin.getContentPane().add(lblOknoPin);
|
||||
|
||||
passwordField = new JPasswordField(0);
|
||||
passwordField.setFont(new Font("Tahoma", Font.PLAIN, 60));
|
||||
passwordField.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
passwordField.setToolTipText("4 cyfry PIN");
|
||||
passwordField.setBounds(753, 211, 157, 73);
|
||||
PodajPin.getContentPane().add(passwordField);
|
||||
|
||||
JButton btnZaloguj = new JButton("Zaloguj");
|
||||
btnZaloguj.setFont(new Font("Tahoma", Font.PLAIN, 50));
|
||||
btnZaloguj.addActionListener(new ActionListener() {
|
||||
@SuppressWarnings("deprecation")
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
try {
|
||||
String query = "SELECT * FROM users WHERE RFID=? and Password=?";
|
||||
PreparedStatement pst2 = conn.prepareStatement(query);
|
||||
pst2.setString(1, "0000");
|
||||
pst2.setString(2, passwordField.getText());
|
||||
ResultSet pass = pst2.executeQuery();
|
||||
int count = 0;
|
||||
while (pass.next()) {
|
||||
count=count+1;
|
||||
}
|
||||
if (count == 1) {
|
||||
passwordField.setText("");
|
||||
JOptionPane.showMessageDialog(PodajPin, "Zalogowano!");
|
||||
PodajPin.setVisible(false);
|
||||
DrukujBilet wybierzMenu = new DrukujBilet();
|
||||
wybierzMenu.oknoDrukujBilet();
|
||||
} else {
|
||||
passwordField.setText("");
|
||||
JOptionPane.showMessageDialog(PodajPin, "NIE Zalogowano!");
|
||||
}
|
||||
pass.close();
|
||||
pst2.close();
|
||||
|
||||
} catch (Exception e1){
|
||||
JOptionPane.showMessageDialog(null, e1);
|
||||
passwordField.setText("");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
btnZaloguj.setBounds(724, 298, 213, 69);
|
||||
PodajPin.getContentPane().add(btnZaloguj);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user