package paket_Kopierer;
import java.awt.BorderLayout;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JTextPane;
import javax.swing.JTextField;
import javax.swing.JTable;
import javax.swing.JList;
import java.awt.Rectangle;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JTextArea;
import java.text.*;
import javax.swing.JCheckBox;
import javax.swing.JPasswordField;
import java.awt.Dimension;
import javax.swing.JInternalFrame;
import javax.swing.JSplitPane;
import javax.swing.JWindow;
public class Fenster extends JFrame
{
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JList jList = null;
private JLabel lbPinNummer = null;
private JLabel lbBestätigen = null;
private JTextField tfKontostand = null;
private JButton btEnde = null;
private JButton btKopieren = null;
private JLabel lbKontostand = null;
private JTextField tfKopien = null;
private Kopierkarte karte1;
private JButton btBestätigen = null;
private JPasswordField pfPinNummer1 = null;
private JLabel lbAnzahlKopien = null;
public Fenster()
{
super();
initialize();
karte1=new Kopierkarte();
}
private void initialize()
{
this.setSize(400, 300);
this.setContentPane(getJContentPane());
this.setTitle("Kopierer ohne DB");
}
private JPanel getJContentPane()
{
if (jContentPane == null)
{
lbAnzahlKopien = new JLabel();
lbAnzahlKopien.setBounds(new Rectangle(20, 140, 150, 25));
lbAnzahlKopien.setText("Anzahl Kopien:");
lbKontostand = new JLabel();
lbKontostand.setBounds(new Rectangle(20, 100, 150, 25));
lbKontostand.setText("aktueller Kontostand:");
lbBestätigen = new JLabel();
lbBestätigen.setBounds(new Rectangle(20, 60, 150, 25));
lbBestätigen.setText("Pin-Nummer bestätigen:");
lbPinNummer = new JLabel();
lbPinNummer.setBounds(new Rectangle(20, 20, 100, 25));
lbPinNummer.setText("Pin-Nummer:");
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(getJList(), null);
jContentPane.add(lbPinNummer, null);
jContentPane.add(lbBestätigen, null);
jContentPane.add(getTfKontostand(), null);
jContentPane.add(getBtEnde(), null);
jContentPane.add(getBtKopieren(), null);
jContentPane.add(lbKontostand, null);
jContentPane.add(getTfKopien(), null);
jContentPane.add(getBtBestätigen(), null);
jContentPane.add(lbAnzahlKopien, null);
jContentPane.add(getPfPinNummer1(), null);
}
return jContentPane;
}
private JList getJList()
{
if (jList == null)
{
jList = new JList();
jList.setBounds(new Rectangle(0, 0, 0, 373));
}
return jList;
}
private JTextField getTfKontostand()
{
if (tfKontostand == null)
{
tfKontostand = new JTextField();
tfKontostand.setBounds(new Rectangle(190, 100, 100, 25));
tfKontostand.setEditable(false);
tfKontostand.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent e)
{
tfKontostand.equals(karte1.getStand());
}
});
}
return tfKontostand;
}
private JButton getBtEnde()
{
if (btEnde == null)
{
btEnde = new JButton();
btEnde.setBounds(new Rectangle(190, 180, 100, 25));
btEnde.setText("Ende");
btEnde.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent e)
{
System.exit(0);
}
});
}
return btEnde;
}
private JButton getBtKopieren()
{
if (btKopieren == null)
{
btKopieren = new JButton();
btKopieren.setBounds(new Rectangle(20, 180, 100, 25));
btKopieren.setText("Kopieren");
btKopieren.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent e)
{
karte1.mindern(Integer.parseInt(tfKopien.getText()));
}
});
}
return btKopieren;
}
private JTextField getTfKopien()
{
if (tfKopien == null)
{
tfKopien = new JTextField();
tfKopien.setBounds(new Rectangle(190, 140, 100, 25));
}
return tfKopien;
}
private JButton getBtBestätigen() {
if (btBestätigen == null ) {
btBestätigen = new JButton();
btBestätigen.setBounds(new Rectangle(190, 60, 100, 25));
btBestätigen.setText("Bestätigen");
btBestätigen.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent e)
{
getPfPinNummer1();
karte1.getPin();
if (pfPinNummer1.equals(karte1.getPin()))
{
getTfKontostand();
}
else
{
JOptionPane.showMessageDialog(null,"Falsche Pin-Nummer******");
}
}
});
}
return btBestätigen;
}
private JPasswordField getPfPinNummer1()
{
if (pfPinNummer1 == null)
{
pfPinNummer1 = new JPasswordField();
pfPinNummer1.setBounds(new Rectangle(188, 16, 101, 32));
}
return pfPinNummer1;
}
}