Update oknoPIN.java

This commit is contained in:
s441433 2019-01-07 00:24:10 +01:00
parent c4d25f7269
commit d80a2663cd

View File

@ -1,4 +1,5 @@
import java.awt.EventQueue; import java.awt.EventQueue;
import java.awt.Toolkit;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JLabel; import javax.swing.JLabel;
@ -17,10 +18,11 @@ import javax.swing.JPasswordField;
import javax.swing.JButton; import javax.swing.JButton;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.Font;
public class oknoPIN { public class oknoPIN {
private JFrame Fame; private JFrame PodajPin;
private JPasswordField passwordField; private JPasswordField passwordField;
/** /**
@ -31,7 +33,7 @@ public class oknoPIN {
public void run() { public void run() {
try { try {
oknoPIN window = new oknoPIN(); oknoPIN window = new oknoPIN();
window.Fame.setVisible(true); window.PodajPin.setVisible(true);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -50,33 +52,38 @@ public class oknoPIN {
* Initialize the contents of the frame. * Initialize the contents of the frame.
*/ */
private void initialize() { private void initialize() {
Fame = new JFrame(); PodajPin = new JFrame();
Fame.setTitle("Podaj PIN"); PodajPin.setTitle("Podaj PIN");
Fame.setBounds(100, 100, 528, 306); PodajPin.setBounds(100, 100, 528, 306);
Fame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); PodajPin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Fame.getContentPane().setLayout(null); PodajPin.getContentPane().setLayout(null);
PodajPin.setSize(1700, 600);
JLabel lblOknoPin = new JLabel("Podaj sw\u00F3j PIN"); JLabel lblOknoPin = new JLabel("Podaj sw\u00F3j PIN");
lblOknoPin.setBounds(165, 58, 167, 58); lblOknoPin.setFont(new Font("Tahoma", Font.PLAIN, 56));
lblOknoPin.setBounds(608, 128, 440, 58);
lblOknoPin.setHorizontalAlignment(SwingConstants.CENTER); lblOknoPin.setHorizontalAlignment(SwingConstants.CENTER);
lblOknoPin.setBackground(Color.YELLOW); lblOknoPin.setBackground(Color.YELLOW);
lblOknoPin.setForeground(Color.BLUE); lblOknoPin.setForeground(Color.BLUE);
Fame.getContentPane().add(lblOknoPin); PodajPin.getContentPane().add(lblOknoPin);
passwordField = new JPasswordField(0); passwordField = new JPasswordField(0);
passwordField.setFont(new Font("Tahoma", Font.PLAIN, 60));
passwordField.setHorizontalAlignment(SwingConstants.CENTER); passwordField.setHorizontalAlignment(SwingConstants.CENTER);
passwordField.setToolTipText("4 cyfry PIN"); passwordField.setToolTipText("4 cyfry PIN");
passwordField.setBounds(205, 111, 89, 22); passwordField.setBounds(753, 211, 157, 73);
Fame.getContentPane().add(passwordField); PodajPin.getContentPane().add(passwordField);
JButton btnZaloguj = new JButton("Zaloguj"); JButton btnZaloguj = new JButton("Zaloguj");
btnZaloguj.setFont(new Font("Tahoma", Font.PLAIN, 50));
btnZaloguj.addActionListener(new ActionListener() { btnZaloguj.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
PodajPin.setVisible(false);
DrukujBilet wybierzMenu = new DrukujBilet(); DrukujBilet wybierzMenu = new DrukujBilet();
wybierzMenu.oknoDrukujBilet(); wybierzMenu.oknoDrukujBilet();
} }
}); });
btnZaloguj.setBounds(205, 165, 97, 25); btnZaloguj.setBounds(724, 298, 213, 69);
Fame.getContentPane().add(btnZaloguj); PodajPin.getContentPane().add(btnZaloguj);
} }
} }