import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.File;
public class Fenster extends Frame
{
//Objekte erzeugen
//Main
//Labels
JLabel lblHeader = new JLabel();
JLabel lblSubHeader1 = new JLabel();
JLabel lblSubHeader2 = new JLabel();
//Liste
//Alle Dateien in Ordner anzeigen
File langDir = new File(".\\Klassen");
String[] languageFiles = langDir.list();
JList lstKLasse = new JList(langDir.list());
JScrollPane scrollPane = new JScrollPane(lstKLasse);
JList lstSchueler = new JList();
//Buttons
JButton bndNewKlasse = new JButton();
JButton bndDelKlasse = new JButton();
JButton bndEditKlasse = new JButton();
JButton bndNC = new JButton();
JButton bndSelectKl = new JButton();
JButton bndDelSchueler = new JButton();
JButton bndEditSchueler = new JButton();
JButton bndNote = new JButton();
JButton bndSelectSch = new JButton();
//Add Schueler
//Panel
JPanel pnlAddSch = new JPanel();
//Labels
JLabel lblSubHeader3 = new JLabel();
JLabel lblAddVorname = new JLabel();
JLabel lblAddNachname = new JLabel();
JLabel lblAddPkt = new JLabel();
//TextFields
TextField txtAddVorname = new TextField();
TextField txtAddNachname = new TextField();
TextField txtAddPkt = new TextField();
//Buttons
JButton bndAddAdd = new JButton();
//Edit Schueler
//Panel
JPanel pnlEditSch = new JPanel();
TitledBorder titledBorder1;
//Labels
JLabel lblSubHeader4 = new JLabel();
JLabel lblEditVorname = new JLabel();
JLabel lblEditNachname = new JLabel();
JLabel lblEditPkt = new JLabel();
//TextFields
TextField txtEditVorname = new TextField();
TextField txtEditNachname = new TextField();
TextField txtEditPkt = new TextField();
//Buttons
JButton bndEditUpt = new JButton();
JScrollBar jScrollBar1 = new JScrollBar();
public Fenster()
{
super("FOSp12d");
this.setSize(450,500);
this.setLayout(null);
this.show();
try
{
jbInit();
}
catch(Exception e)
{
//e.printStackTrace();
}
}
private void jbInit() throws Exception
{
titledBorder1 = new TitledBorder("");
lblHeader.setFont(new java.awt.Font("Dialog", 0, 25));
lblHeader.setText("NC Calc");
lblHeader.setBounds(new Rectangle(174, 22, 105, 44));
this.setFocusable(false);
this.setResizable(false);
lstKLasse.setBackground(SystemColor.desktop);
lstKLasse.setAutoscrolls(true);
lstKLasse.setDebugGraphicsOptions(0);
lstKLasse.setRequestFocusEnabled(true);
lstKLasse.setToolTipText("");
lstKLasse.setPrototypeCellValue(null);
lstKLasse.setBounds(new Rectangle(12, 93, 110, 140));
lblSubHeader1.setText("Waehlen Sie eine Klasse...");
lblSubHeader1.setBounds(new Rectangle(13, 67, 195, 29));
lstSchueler.setBackground(SystemColor.desktop);
lstSchueler.setBounds(new Rectangle(215, 93, 125, 141));
lblSubHeader2.setText("Waehlen Sie einen Schueler...");
lblSubHeader2.setBounds(new Rectangle(214, 70, 186, 23));
bndSelectSch.setText("Select");
bndSelectSch.setBounds(new Rectangle(214, 239, 127, 37));
bndDelSchueler.setBounds(new Rectangle(345, 95, 90, 32));
bndDelSchueler.setText("Delete");
bndEditSchueler.setText("Edit");
bndEditSchueler.setBounds(new Rectangle(345, 135, 90, 32));
bndDelKlasse.setText("Delete");
bndDelKlasse.setBounds(new Rectangle(123, 128, 90, 32));
bndEditKlasse.setBounds(new Rectangle(123, 162, 90, 32));
bndEditKlasse.setText("Edit");
pnlAddSch.setBorder(titledBorder1);
pnlAddSch.setDebugGraphicsOptions(DebugGraphics.LOG_OPTION);
pnlAddSch.setRequestFocusEnabled(false);
pnlAddSch.setToolTipText("");
pnlAddSch.setVerifyInputWhenFocusTarget(true);
pnlAddSch.setActionMap(null);
pnlAddSch.setLayout(null);
pnlAddSch.setBounds(new Rectangle(4, 302, 215, 172));
lblSubHeader3.setFont(new java.awt.Font("Dialog", 1, 15));
lblSubHeader3.setForeground(Color.black);
lblSubHeader3.setText("Add Schueler");
lblSubHeader3.setBounds(new Rectangle(58, 1, 103, 36));
lblAddVorname.setText("Vorname:");
lblAddVorname.setBounds(new Rectangle(6, 31, 61, 33));
lblAddNachname.setBounds(new Rectangle(6, 59, 71, 33));
lblAddNachname.setText("Nachname:");
lblAddPkt.setText("Punkte:");
lblAddPkt.setBounds(new Rectangle(6, 86, 71, 33));
txtAddVorname.setText("");
txtAddVorname.setBounds(new Rectangle(79, 37, 106, 23));
txtAddNachname.setText("");
txtAddNachname.setBounds(new Rectangle(79, 64, 106, 23));
txtAddPkt.setText("");
txtAddPkt.setBounds(new Rectangle(80, 92, 106, 23));
lblSubHeader4.setBounds(new Rectangle(58, 1, 103, 36));
lblSubHeader4.setText("Edit Schueler");
lblSubHeader4.setForeground(Color.black);
lblSubHeader4.setFont(new java.awt.Font("Dialog", 1, 15));
txtEditNachname.setText("");
txtEditNachname.setBounds(new Rectangle(79, 64, 106, 23));
pnlEditSch.setBounds(new Rectangle(224, 302, 215, 172));
pnlEditSch.setLayout(null);
pnlEditSch.setActionMap(null);
pnlEditSch.setVerifyInputWhenFocusTarget(true);
pnlEditSch.setToolTipText("");
pnlEditSch.setRequestFocusEnabled(false);
pnlEditSch.setDebugGraphicsOptions(DebugGraphics.LOG_OPTION);
pnlEditSch.setBorder(titledBorder1);
txtEditPkt.setBounds(new Rectangle(80, 92, 106, 23));
lblEditNachname.setBounds(new Rectangle(6, 59, 71, 33));
lblEditNachname.setText("Nachname:");
lblEditPkt.setText("Punkte:");
lblEditPkt.setBounds(new Rectangle(6, 86, 71, 33));
txtEditVorname.setText("");
txtEditVorname.setBounds(new Rectangle(79, 37, 106, 23));
lblEditVorname.setText("Vorname:");
lblEditVorname.setBounds(new Rectangle(6, 31, 61, 33));
bndAddAdd.setBounds(new Rectangle(50, 126, 102, 31));
bndAddAdd.setActionCommand("");
bndAddAdd.setText("Add");
bndEditUpt.setText("Update");
bndEditUpt.setBounds(new Rectangle(48, 125, 102, 31));
bndEditUpt.setActionCommand("");
bndNote.setBounds(new Rectangle(344, 174, 90, 32));
bndNote.setText("Note");
bndNC.setText("NC");
bndNC.setBounds(new Rectangle(123, 196, 90, 32));
bndNewKlasse.setBounds(new Rectangle(124, 93, 90, 32));
bndNewKlasse.setText("New");
bndNewKlasse.addMouseListener(new Fenster_bndNewKlasse_mouseAdapter(this));
bndSelectKl.setBounds(new Rectangle(11, 239, 112, 37));
bndSelectKl.setText("Select");
jScrollBar1.setBounds(new Rectangle(102, 94, 20, 140));
this.add(lblSubHeader1, null);
this.add(lstKLasse, null);
this.add(lblHeader, null);
this.add(bndDelSchueler, null);
this.add(lstSchueler, null);
this.add(bndSelectSch, null);
this.add(pnlAddSch, null);
pnlAddSch.add(lblAddVorname, null);
pnlAddSch.add(lblAddNachname, null);
pnlAddSch.add(lblAddPkt, null);
pnlAddSch.add(txtAddVorname, null);
pnlAddSch.add(txtAddNachname, null);
pnlAddSch.add(txtAddPkt, null);
pnlAddSch.add(lblSubHeader3, null);
pnlAddSch.add(bndAddAdd, null);
this.add(pnlEditSch, null);
pnlEditSch.add(lblEditVorname, null);
pnlEditSch.add(lblEditNachname, null);
pnlEditSch.add(lblEditPkt, null);
pnlEditSch.add(txtEditVorname, null);
pnlEditSch.add(txtEditNachname, null);
pnlEditSch.add(txtEditPkt, null);
pnlEditSch.add(lblSubHeader4, null);
pnlEditSch.add(bndEditUpt, null);
this.add(bndEditSchueler, null);
this.add(bndNote, null);
//Button "Neue Klasse erzeugen" anzeigen
this.add(bndNewKlasse, null);
this.add(bndDelKlasse, null);
this.add(bndEditKlasse, null);
this.add(bndNC, null);
this.add(lblSubHeader2, null);
this.add(bndSelectKl, null);
this.add(jScrollBar1, null);
this.setIgnoreRepaint(false);
this.setBackground(SystemColor.controlHighlight);
this.setLayout(null);
}
//Button event fuer "neue Klasse anlegen" ####################################
void bndNewKlasse_mouseClicked(MouseEvent e)
{
//Wird bei Clicken ausgefuehrt
NeueKlasse NK = new NeueKlasse();
}
//############################################################################
}
//Java class fuer "Neue Klasse anlegen" ######################################
class Fenster_bndNewKlasse_mouseAdapter extends java.awt.event.MouseAdapter
{
Fenster adaptee;
Fenster_bndNewKlasse_mouseAdapter(Fenster adaptee)
{
this.adaptee = adaptee;
}
public void mouseClicked(MouseEvent e)
{
adaptee.bndNewKlasse_mouseClicked(e);
}
}
//###########################################################################