import java.awt.*;
import java.awt.event.*;
public class PanelDVD extends Frame
implements WindowListener, ActionListener
{
Panel p = new Panel();
private Button btNew = new Button(" Neu ");
private Button btSave = new Button(" Speichern ");
private Button btClose = new Button(" Schließen ");
private Label l1 = new Label("DVD-Titel: ");
private Label l2 = new Label("DVD-ID: ");
private Label l3 = new Label("Erscheinungsjahr: ");
private Label l4 = new Label("Status: ");
private Label l5 = new Label("Status-ID: ");
private Label l6 = new Label("Verleihdatum: ");
private Label l7 = new Label("Verleihgebühren: ");
private Label l8 = new Label("Gebühr-ID: ");
private Label l9 = new Label(" DVD - Verwaltung ");
TextField tf1 = new TextField ();
TextField tf2 = new TextField ();
TextField tf3 = new TextField ();
TextField tf4 = new TextField ();
TextField tf5 = new TextField ();
TextField tf6 = new TextField ();
TextField tf7 = new TextField ();
TextField tf8 = new TextField ();
public PanelDVD()
{
setExtendedState(Frame.MAXIMIZED_BOTH);
add(p);
p.setLayout(null);
p.setBackground(Color.lightGray);
this.addWindowListener (this);
btNew.addActionListener (this);
btSave.addActionListener (this);
btClose.addActionListener(this);
btNew.setBounds (new Rectangle (680,450,70,21));
btSave.setBounds (new Rectangle (680,480,70,21));
btClose.setBounds(new Rectangle (680,510,70,21));
tf1.setBounds (new Rectangle(500,280,120,21));
tf2.setBounds (new Rectangle(500,300,120,21));
tf3.setBounds (new Rectangle(500,320,120,21));
tf4.setBounds (new Rectangle(500,340,120,21));
tf5.setBounds (new Rectangle(500,360,120,21));
tf6.setBounds (new Rectangle(500,380,120,21));
tf7.setBounds (new Rectangle(500,400,120,21));
tf8.setBounds (new Rectangle(500,420,120,21));
l1.setBounds (new Rectangle(300,280,140,21));
l2.setBounds (new Rectangle(300,300,140,21));
l3.setBounds (new Rectangle(300,320,140,21));
l4.setBounds (new Rectangle(300,340,140,21));
l5.setBounds (new Rectangle(300,360,140,21));
l6.setBounds (new Rectangle(300,380,140,21));
l7.setBounds (new Rectangle(300,400,140,21));
l8.setBounds (new Rectangle(300,420,140,21));
l9.setBounds (new Rectangle(400,180,200,25));
/*tf1.setBackground(Color.lightGray);
tf2.setBackground(Color.lightGray);
tf3.setBackground(Color.lightGray);
tf4.setBackground(Color.lightGray);
tf5.setBackground(Color.lightGray);
tf6.setBackground(Color.lightGray);
tf7.setBackground(Color.lightGray);
tf8.setBackground(Color.lightGray);
*/
p.add(tf1,null);
p.add(tf2,null);
p.add(tf3,null);
p.add(tf4,null);
p.add(tf5,null);
p.add(tf6,null);
p.add(tf7,null);
p.add(tf8,null);
Font f = new Font("Comic Sans MS", Font.ITALIC, 16);
l1.setFont(f);
l2.setFont(f);
l3.setFont(f);
l4.setFont(f);
l5.setFont(f);
l6.setFont(f);
l7.setFont(f);
l8.setFont(f);
Font f1 = new Font("Comic Sans MS", Font.ITALIC, 22);
l9.setFont(f1);
p.add(l1, null);
p.add(l2, null);
p.add(l3, null);
p.add(l4, null);
p.add(l5, null);
p.add(l6, null);
p.add(l7, null);
p.add(l8, null);
p.add(l9, null);
p.add(btNew, null);
p.add(btSave, null);
p.add(btClose, null);
}
public void paint(Graphics g)
{
Font f = new Font("Comic Sans MS", Font.ITALIC, 30);
g.setFont(f);
}
public static void main(String[] args)
{
PanelDVD eFenster = new PanelDVD();
eFenster.setSize(520, 400);
eFenster.setLocation(250,130);
eFenster.setVisible(true);
}
public void windowDeactivated(WindowEvent e)
{
}
public void windowActivated(WindowEvent e)
{
}
public void windowDeiconified(WindowEvent e)
{
}
public void windowIconified(WindowEvent e)
{
}
public void windowClosed(WindowEvent e)
{
}
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
public void windowOpened(WindowEvent e)
{
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==btClose)
System.exit(0);
if(e.getSource()==btNew)
{
tf1.setText("");
tf2.setText("");
tf3.setText("");
tf4.setText("");
tf5.setText("");
tf6.setText("");
tf7.setText("");
tf8.setText("");
}
}
}