Create StolowkaZPM.java

This commit is contained in:
s441433 2019-01-06 17:06:38 +01:00
parent 8eeb6e1709
commit 697f3d5895

View File

@ -0,0 +1,105 @@
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JOptionPane;
//import javax.swing.JTextField;
import javax.swing.JLabel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JPasswordField;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.*;
import javax.swing.JPanel;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import javax.swing.JDesktopPane;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
//import javax.swing.JPanel;
public class StolowkaZPM {
private JFrame frmStowkaZpm;
private JPasswordField rfidView;
private JLabel lblNewLabel;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
StolowkaZPM window = new StolowkaZPM();
window.frmStowkaZpm.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public StolowkaZPM() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frmStowkaZpm = new JFrame();
frmStowkaZpm.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent arg0) {
}
});
//Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
//int x = (int) ((size.getWidth() - frmStowkaZpm.getWidth()) / 2);
//int y = (int) ((size.getHeight() - frmStowkaZpm.getHeight()) / 2);
//frmStowkaZpm.setLocation(x, y);
frmStowkaZpm.setTitle("Sto\u0142\u00F3wka ZPM");
frmStowkaZpm.setBounds(1, 1, 499, 356);
frmStowkaZpm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frmStowkaZpm.getContentPane().setLayout(new GridLayout(0, 1, 0, 0));
lblNewLabel = new JLabel("\"Sto\u0142\u00F3wka ZPM\"");
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 70));
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
frmStowkaZpm.getContentPane().add(lblNewLabel);
JLabel lblZbliKartDo = new JLabel("Zbli\u017C kart\u0119 do czytnika RFID");
lblZbliKartDo.setHorizontalAlignment(SwingConstants.CENTER);
frmStowkaZpm.getContentPane().add(lblZbliKartDo);
lblZbliKartDo.setFont(new Font("Tahoma", Font.PLAIN, 40));
rfidView = new JPasswordField();
rfidView.setHorizontalAlignment(SwingConstants.CENTER);
frmStowkaZpm.getContentPane().add(rfidView);
rfidView.setFont(new Font("Tahoma", Font.PLAIN, 17));
rfidView.addActionListener(new ActionListener() {
@SuppressWarnings("static-access")
public void actionPerformed(ActionEvent e) {
@SuppressWarnings("deprecation")
String RFID = rfidView.getText();
if (RFID.equals("0005492974")){
rfidView.setText("");
//JOptionPane.showMessageDialog(frmStowkaZpm, "Zalogowano!");
oknoPIN wpiszPin = new oknoPIN();
wpiszPin.noweOkno();
} else {
rfidView.setText("");
//JOptionPane.showMessageDialog(frmStowkaZpm, "NIE Zalogowano!");
}
}
});
rfidView.setToolTipText("numer karty");
}
}