Student Mannager System
parent
e519effaf5
commit
4191855611
|
@ -0,0 +1,49 @@
|
|||
package GUIAnwendungen.StudentManagementSystem;
|
||||
|
||||
public class Controller {
|
||||
|
||||
private Student student;
|
||||
private Student_login view;
|
||||
|
||||
public Controller() {
|
||||
this.view = new Student_login();
|
||||
view.getInsertStudent().addActionListener(e -> login());
|
||||
|
||||
}
|
||||
|
||||
public void login() {
|
||||
|
||||
String idText = view.getEingabeId().getText();
|
||||
int id = Integer.parseInt(idText);
|
||||
String name = view.getEingabeName().getText();
|
||||
String vorname = view.getEingabeVorname().getText();
|
||||
String geburtstag = view.getEingabeGeburtstag().getText();
|
||||
String geschlecht = view.getEingabeGeschlecht().getSelectedItem().toString();
|
||||
String teleN = view.getEingabeTeleN().getText();
|
||||
String email = view.getEingabeEmail().getText();
|
||||
String Adresse = view.getEingabeAdresse().getText();
|
||||
|
||||
student = LoginStudent.login(name,vorname,geschlecht,email,teleN,Adresse,geburtstag,id);
|
||||
|
||||
String[] werte = {student.getId()+"",student.getName(), student.getVorname(), student.getGeburtstag(),student.getGeschlecht(), student.getTele(), student.getEmail(), student.getAdresse()};
|
||||
view.getModel().addRow(werte);
|
||||
System.out.println("Erfolgreich");
|
||||
restAlleInputs();
|
||||
|
||||
}
|
||||
|
||||
public void restAlleInputs() {
|
||||
view.setEingabeName("");;
|
||||
view.setEingabeTeleN("");
|
||||
view.setEingabeAdresse("");
|
||||
view.setEingabeEmail("");;
|
||||
view.setEingabeGeburtstag("");;
|
||||
view.setEingabeVorname("");
|
||||
view.setEingabeId("");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Controller();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package GUIAnwendungen.StudentManagementSystem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class LoginStudent {
|
||||
|
||||
private static ArrayList<Student> alleStudent = new ArrayList<>();
|
||||
|
||||
public static Student login(String name, String vorname, String geschlecht, String email, String teleN, String Adresse,String geburtstag, int id) {
|
||||
Student studen = new Student(name, vorname, geschlecht, email, teleN, Adresse, geburtstag, id);
|
||||
alleStudent.add(studen);
|
||||
|
||||
return studen;
|
||||
}
|
||||
|
||||
public ArrayList<Student> getalleStudent(){
|
||||
return alleStudent;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,137 +0,0 @@
|
|||
package GUIAnwendungen.StudentManagementSystem;
|
||||
|
||||
import java.awt.EventQueue;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import java.awt.Color;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.AbstractListModel;
|
||||
import javax.swing.JRadioButton;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.ListSelectionModel;
|
||||
|
||||
public class Login_Student extends JFrame {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private JPanel contentPane;
|
||||
private JTextField eingabeID;
|
||||
private JTextField eingabeName;
|
||||
private JTextField eingabeVorname;
|
||||
private JTextField einagbeGeburtstag;
|
||||
private JTextField eingabeTeleN;
|
||||
private JTextField eingabeAdresse;
|
||||
static JScrollPane listScrollPane = new JScrollPane();
|
||||
/**
|
||||
* Launch the application.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
Login_Student frame = new Login_Student();
|
||||
frame.setVisible(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the frame.
|
||||
*/
|
||||
public Login_Student() {
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setBounds(100, 100, 617, 421);
|
||||
contentPane = new JPanel();
|
||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
|
||||
setContentPane(contentPane);
|
||||
contentPane.setLayout(null);
|
||||
|
||||
JPanel panel = new JPanel();
|
||||
panel.setBackground(new Color(98, 160, 234));
|
||||
panel.setBounds(12, 28, 244, 381);
|
||||
contentPane.add(panel);
|
||||
panel.setLayout(null);
|
||||
|
||||
JLabel studentId = new JLabel("ID: ");
|
||||
studentId.setBounds(12, 12, 77, 17);
|
||||
panel.add(studentId);
|
||||
|
||||
JLabel name = new JLabel("Name: ");
|
||||
name.setBounds(12, 52, 98, 17);
|
||||
panel.add(name);
|
||||
|
||||
JLabel geburtstag = new JLabel("Geburtstag: ");
|
||||
geburtstag.setBounds(12, 130, 98, 17);
|
||||
panel.add(geburtstag);
|
||||
|
||||
JLabel geschlecht = new JLabel("Geschlecht:");
|
||||
geschlecht.setBounds(12, 170, 98, 17);
|
||||
panel.add(geschlecht);
|
||||
|
||||
JLabel tele = new JLabel("TeleN: ");
|
||||
tele.setBounds(12, 212, 60, 17);
|
||||
panel.add(tele);
|
||||
|
||||
JLabel adresse = new JLabel("Adresse: ");
|
||||
adresse.setBounds(12, 251, 60, 17);
|
||||
panel.add(adresse);
|
||||
|
||||
JLabel vorname = new JLabel("Vorname: ");
|
||||
vorname.setBounds(12, 91, 98, 17);
|
||||
panel.add(vorname);
|
||||
|
||||
JButton insertStudent = new JButton("Insert");
|
||||
insertStudent.setBounds(5, 294, 105, 27);
|
||||
panel.add(insertStudent);
|
||||
|
||||
JButton updateStudent = new JButton("Update");
|
||||
updateStudent.setBounds(127, 294, 105, 27);
|
||||
panel.add(updateStudent);
|
||||
|
||||
eingabeID = new JTextField();
|
||||
eingabeID.setBounds(118, 10, 114, 21);
|
||||
panel.add(eingabeID);
|
||||
eingabeID.setColumns(10);
|
||||
|
||||
eingabeName = new JTextField();
|
||||
eingabeName.setColumns(10);
|
||||
eingabeName.setBounds(118, 50, 114, 21);
|
||||
panel.add(eingabeName);
|
||||
|
||||
eingabeVorname = new JTextField();
|
||||
eingabeVorname.setColumns(10);
|
||||
eingabeVorname.setBounds(118, 89, 114, 21);
|
||||
panel.add(eingabeVorname);
|
||||
|
||||
einagbeGeburtstag = new JTextField();
|
||||
einagbeGeburtstag.setColumns(10);
|
||||
einagbeGeburtstag.setBounds(118, 128, 114, 21);
|
||||
panel.add(einagbeGeburtstag);
|
||||
|
||||
eingabeTeleN = new JTextField();
|
||||
eingabeTeleN.setColumns(10);
|
||||
eingabeTeleN.setBounds(118, 210, 114, 21);
|
||||
panel.add(eingabeTeleN);
|
||||
|
||||
eingabeAdresse = new JTextField();
|
||||
eingabeAdresse.setColumns(10);
|
||||
eingabeAdresse.setBounds(118, 249, 114, 21);
|
||||
panel.add(eingabeAdresse);
|
||||
|
||||
|
||||
|
||||
JList geshlechtAuswaehlen = new JList();
|
||||
geshlechtAuswaehlen.setToolTipText("");
|
||||
geshlechtAuswaehlen.setBounds(118, 170, 114, 17);
|
||||
panel.add(geshlechtAuswaehlen);
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package GUIAnwendungen.StudentManagementSystem;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Student st = new Student.StudenBuilder()
|
||||
.setName("Albek")
|
||||
.setVorname("Obai")
|
||||
.setAdresse("Gärtnerstr.25")
|
||||
.setEmail("Obai@gmail.com")
|
||||
.setGeburtstag("01.01.2001")
|
||||
.setGeschlecht('M')
|
||||
.setTele("00493213213")
|
||||
.setId(100)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -4,84 +4,88 @@ public class Student {
|
|||
|
||||
private String name;
|
||||
private String vorname;
|
||||
private char geschlecht;
|
||||
private String geschlecht;
|
||||
private String email;
|
||||
private String tele;
|
||||
private String adresse;
|
||||
private String geburtstag;
|
||||
private int id;
|
||||
|
||||
private Student(StudenBuilder student) {
|
||||
this.name = student.name;
|
||||
this.vorname = student.vorname;
|
||||
this.geschlecht = student.geschlecht;
|
||||
this.email = student.email;
|
||||
this.tele = student.tele;
|
||||
this.adresse = student.adresse;
|
||||
this.geburtstag = student.geburtstag;
|
||||
this.id = student.id;
|
||||
public Student(String name, String vorname, String geschlecht, String email, String tele, String adresse,
|
||||
String geburtstag, int id) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.vorname = vorname;
|
||||
this.geschlecht = geschlecht;
|
||||
this.email = email;
|
||||
this.tele = tele;
|
||||
this.adresse = adresse;
|
||||
this.geburtstag = geburtstag;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public static class StudenBuilder {
|
||||
private String name;
|
||||
private String vorname;
|
||||
private char geschlecht;
|
||||
private String email;
|
||||
private String tele;
|
||||
private String adresse;
|
||||
private String geburtstag;
|
||||
private int id;
|
||||
|
||||
|
||||
public StudenBuilder setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StudenBuilder setVorname(String vorname) {
|
||||
this.vorname = vorname;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StudenBuilder setGeschlecht(char geschlecht) {
|
||||
this.geschlecht = geschlecht;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StudenBuilder setEmail(String email) {
|
||||
this.email = email;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StudenBuilder setTele(String tele) {
|
||||
this.tele = tele;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StudenBuilder setAdresse(String adresse) {
|
||||
this.adresse = adresse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StudenBuilder setGeburtstag(String geburtstag) {
|
||||
this.geburtstag = geburtstag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StudenBuilder setId(int id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Student build() {
|
||||
return new Student(this);
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Student [name=" + name + ", vorname=" + vorname + ", geschlecht=" + geschlecht + ", email=" + email
|
||||
+ ", tele=" + tele + ", adresse=" + adresse + ", geburtstag=" + geburtstag + ", id=" + id + "]";
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getVorname() {
|
||||
return vorname;
|
||||
}
|
||||
|
||||
public void setVorname(String vorname) {
|
||||
this.vorname = vorname;
|
||||
}
|
||||
|
||||
public String getGeschlecht() {
|
||||
return geschlecht;
|
||||
}
|
||||
|
||||
public void setGeschlecht(String geschlecht) {
|
||||
this.geschlecht = geschlecht;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getTele() {
|
||||
return tele;
|
||||
}
|
||||
|
||||
public void setTele(String tele) {
|
||||
this.tele = tele;
|
||||
}
|
||||
|
||||
public String getAdresse() {
|
||||
return adresse;
|
||||
}
|
||||
|
||||
public void setAdresse(String adresse) {
|
||||
this.adresse = adresse;
|
||||
}
|
||||
|
||||
public String getGeburtstag() {
|
||||
return geburtstag;
|
||||
}
|
||||
|
||||
public void setGeburtstag(String geburtstag) {
|
||||
this.geburtstag = geburtstag;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,358 @@
|
|||
package GUIAnwendungen.StudentManagementSystem;
|
||||
|
||||
import java.awt.EventQueue;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import java.awt.Color;
|
||||
import javax.swing.JLabel;
|
||||
import java.awt.Font;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.JList;
|
||||
import java.awt.ScrollPane;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.ListSelectionModel;
|
||||
|
||||
public class Student_login extends JFrame {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private JPanel contentPane;
|
||||
private JTextField eingabeId;
|
||||
private JTextField eingabeName;
|
||||
private JTextField eingabeVorname;
|
||||
private JTextField eingabeGeburtstag;
|
||||
private JTextField eingabeTeleN;
|
||||
private JTextField eingabeEmail;
|
||||
private JTextField eingabeAdresse;
|
||||
private JTextField eingabeIdZuLoeschen;
|
||||
private JTextField eingabeNameZuSuchen;
|
||||
private JButton insertStudent;
|
||||
private JButton updateStudent;
|
||||
private JButton loescheStudent;
|
||||
private JButton sucheStudent;
|
||||
private JButton zeigeAlleStudent;
|
||||
private DefaultTableModel model = new DefaultTableModel();
|
||||
private JTable table;
|
||||
private JComboBox eingabeGeschlecht;
|
||||
|
||||
|
||||
|
||||
|
||||
public Student_login() {
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setBounds(100, 100, 852, 511);
|
||||
contentPane = new JPanel();
|
||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
|
||||
setContentPane(contentPane);
|
||||
contentPane.setLayout(null);
|
||||
|
||||
JPanel loesche_suche = new JPanel();
|
||||
loesche_suche.setBackground(new Color(0, 128, 255));
|
||||
loesche_suche.setBounds(0, 0, 257, 412);
|
||||
contentPane.add(loesche_suche);
|
||||
loesche_suche.setLayout(null);
|
||||
|
||||
JLabel idStudent = new JLabel("ID: ");
|
||||
idStudent.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
idStudent.setForeground(new Color(255, 255, 255));
|
||||
idStudent.setBounds(10, 11, 46, 14);
|
||||
loesche_suche.add(idStudent);
|
||||
|
||||
JLabel nameStudent = new JLabel("Name: ");
|
||||
nameStudent.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
nameStudent.setForeground(new Color(255, 255, 255));
|
||||
nameStudent.setBounds(10, 47, 46, 14);
|
||||
loesche_suche.add(nameStudent);
|
||||
|
||||
JLabel vorname_student = new JLabel("Vorname:");
|
||||
vorname_student.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
vorname_student.setForeground(new Color(255, 255, 255));
|
||||
vorname_student.setBounds(10, 81, 61, 14);
|
||||
loesche_suche.add(vorname_student);
|
||||
|
||||
JLabel geburtstagStudent = new JLabel("Geburtstag: ");
|
||||
geburtstagStudent.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
geburtstagStudent.setForeground(new Color(255, 255, 255));
|
||||
geburtstagStudent.setBounds(10, 122, 77, 14);
|
||||
loesche_suche.add(geburtstagStudent);
|
||||
|
||||
JLabel geschlechtStudent = new JLabel("Geschlecht: ");
|
||||
geschlechtStudent.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
geschlechtStudent.setForeground(new Color(255, 255, 255));
|
||||
geschlechtStudent.setBounds(10, 160, 77, 14);
|
||||
loesche_suche.add(geschlechtStudent);
|
||||
|
||||
JLabel teleNStudent = new JLabel("TeleN: ");
|
||||
teleNStudent.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
teleNStudent.setForeground(new Color(255, 255, 255));
|
||||
teleNStudent.setBounds(10, 198, 46, 14);
|
||||
loesche_suche.add(teleNStudent);
|
||||
|
||||
JLabel emailStudent = new JLabel("Email: ");
|
||||
emailStudent.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
emailStudent.setForeground(new Color(255, 255, 255));
|
||||
emailStudent.setBounds(10, 239, 46, 14);
|
||||
loesche_suche.add(emailStudent);
|
||||
|
||||
JLabel adresseStudent = new JLabel("Adresse:");
|
||||
adresseStudent.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
adresseStudent.setForeground(new Color(255, 255, 255));
|
||||
adresseStudent.setBounds(10, 280, 61, 14);
|
||||
loesche_suche.add(adresseStudent);
|
||||
|
||||
insertStudent = new JButton("Insert");
|
||||
insertStudent.setBounds(10, 340, 89, 23);
|
||||
loesche_suche.add(insertStudent);
|
||||
|
||||
updateStudent = new JButton("Update");
|
||||
updateStudent.setBounds(120, 340, 89, 23);
|
||||
loesche_suche.add(updateStudent);
|
||||
|
||||
eingabeId = new JTextField();
|
||||
eingabeId.setBounds(161, 11, 86, 20);
|
||||
loesche_suche.add(eingabeId);
|
||||
eingabeId.setColumns(10);
|
||||
|
||||
eingabeName = new JTextField();
|
||||
eingabeName.setColumns(10);
|
||||
eingabeName.setBounds(161, 45, 86, 20);
|
||||
loesche_suche.add(eingabeName);
|
||||
|
||||
eingabeVorname = new JTextField();
|
||||
eingabeVorname.setColumns(10);
|
||||
eingabeVorname.setBounds(161, 79, 86, 20);
|
||||
loesche_suche.add(eingabeVorname);
|
||||
|
||||
eingabeGeburtstag = new JTextField();
|
||||
eingabeGeburtstag.setColumns(10);
|
||||
eingabeGeburtstag.setBounds(161, 120, 86, 20);
|
||||
loesche_suche.add(eingabeGeburtstag);
|
||||
|
||||
eingabeTeleN = new JTextField();
|
||||
eingabeTeleN.setColumns(10);
|
||||
eingabeTeleN.setBounds(161, 196, 86, 20);
|
||||
loesche_suche.add(eingabeTeleN);
|
||||
|
||||
eingabeEmail = new JTextField();
|
||||
eingabeEmail.setColumns(10);
|
||||
eingabeEmail.setBounds(161, 237, 86, 20);
|
||||
loesche_suche.add(eingabeEmail);
|
||||
|
||||
eingabeAdresse = new JTextField();
|
||||
eingabeAdresse.setColumns(10);
|
||||
eingabeAdresse.setBounds(161, 278, 86, 20);
|
||||
loesche_suche.add(eingabeAdresse);
|
||||
|
||||
eingabeGeschlecht = new JComboBox();
|
||||
eingabeGeschlecht.setModel(new DefaultComboBoxModel(new String[] {"Mähnlich", "Weiblich", "Divers"}));
|
||||
eingabeGeschlecht.setBounds(161, 157, 86, 22);
|
||||
loesche_suche.add(eingabeGeschlecht);
|
||||
|
||||
JPanel panel_1 = new JPanel();
|
||||
panel_1.setBackground(new Color(128, 255, 0));
|
||||
panel_1.setBounds(256, 0, 512, 121);
|
||||
contentPane.add(panel_1);
|
||||
panel_1.setLayout(null);
|
||||
|
||||
loescheStudent = new JButton("Löschen");
|
||||
loescheStudent.setBounds(10, 11, 89, 23);
|
||||
panel_1.add(loescheStudent);
|
||||
|
||||
sucheStudent = new JButton("Suchen");
|
||||
sucheStudent.setBounds(10, 45, 89, 23);
|
||||
panel_1.add(sucheStudent);
|
||||
|
||||
zeigeAlleStudent = new JButton("Zeige Alle");
|
||||
zeigeAlleStudent.setBounds(10, 79, 89, 23);
|
||||
panel_1.add(zeigeAlleStudent);
|
||||
|
||||
eingabeIdZuLoeschen = new JTextField();
|
||||
eingabeIdZuLoeschen.setBounds(132, 12, 86, 20);
|
||||
panel_1.add(eingabeIdZuLoeschen);
|
||||
eingabeIdZuLoeschen.setColumns(10);
|
||||
|
||||
eingabeNameZuSuchen = new JTextField();
|
||||
eingabeNameZuSuchen.setColumns(10);
|
||||
eingabeNameZuSuchen.setBounds(132, 46, 86, 20);
|
||||
panel_1.add(eingabeNameZuSuchen);
|
||||
|
||||
JLabel InfoLabel = new JLabel("<< Gib ID an");
|
||||
InfoLabel.setBounds(241, 15, 196, 14);
|
||||
panel_1.add(InfoLabel);
|
||||
|
||||
JLabel InfoLabel_1 = new JLabel("<< Gib Name an");
|
||||
InfoLabel_1.setBounds(241, 49, 196, 14);
|
||||
panel_1.add(InfoLabel_1);
|
||||
|
||||
JPanel zeigeAllePanel = new JPanel();
|
||||
zeigeAllePanel.setForeground(new Color(192, 192, 192));
|
||||
zeigeAllePanel.setBounds(256, 120, 512, 284);
|
||||
contentPane.add(zeigeAllePanel);
|
||||
|
||||
zeigeAllePanel.setLayout(null);
|
||||
|
||||
table = new JTable(model);
|
||||
model.addColumn("Id");
|
||||
model.addColumn("Name");
|
||||
model.addColumn("Vorname");
|
||||
model.addColumn("Geburtstag");
|
||||
model.addColumn("Geschlecht");
|
||||
model.addColumn("TeleN");
|
||||
model.addColumn("Email");
|
||||
model.addColumn("Adresse");
|
||||
|
||||
|
||||
JScrollPane scrollPane = new JScrollPane(table);
|
||||
scrollPane.setBounds(0, 0, 512, 284);
|
||||
zeigeAllePanel.add(scrollPane);
|
||||
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
public JTextField getEingabeId() {
|
||||
return eingabeId;
|
||||
}
|
||||
|
||||
public JTextField getEingabeName() {
|
||||
return eingabeName;
|
||||
}
|
||||
|
||||
public JTextField getEingabeVorname() {
|
||||
return eingabeVorname;
|
||||
}
|
||||
|
||||
public JTextField getEingabeGeburtstag() {
|
||||
return eingabeGeburtstag;
|
||||
}
|
||||
|
||||
public JTextField getEingabeTeleN() {
|
||||
return eingabeTeleN;
|
||||
}
|
||||
|
||||
public JTextField getEingabeEmail() {
|
||||
return eingabeEmail;
|
||||
}
|
||||
|
||||
public JTextField getEingabeAdresse() {
|
||||
return eingabeAdresse;
|
||||
}
|
||||
|
||||
public JTextField getEingabeIdZuLoeschen() {
|
||||
return eingabeIdZuLoeschen;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setEingabeId(String id) {
|
||||
this.eingabeId.setText(id);
|
||||
}
|
||||
|
||||
public void setEingabeName(String eingabeName) {
|
||||
this.eingabeName.setText(eingabeName);;
|
||||
}
|
||||
|
||||
public void setEingabeVorname(String eingabeVorname) {
|
||||
this.eingabeVorname.setText(eingabeVorname);;
|
||||
}
|
||||
|
||||
public void setEingabeGeburtstag(String eingabeGeburtstag) {
|
||||
this.eingabeGeburtstag.setText(eingabeGeburtstag);;
|
||||
}
|
||||
|
||||
public void setEingabeTeleN(String eingabeTeleN) {
|
||||
this.eingabeTeleN.setText(eingabeTeleN);;
|
||||
}
|
||||
|
||||
public void setEingabeEmail(String eingabeEmail) {
|
||||
this.eingabeEmail.setText(eingabeEmail);;
|
||||
}
|
||||
|
||||
public void setEingabeAdresse(String eingabeAdresse) {
|
||||
this.eingabeAdresse.setText(eingabeAdresse);;
|
||||
}
|
||||
|
||||
public void setEingabeIdZuLoeschen(String eingabeIdZuLoeschen) {
|
||||
this.eingabeIdZuLoeschen.setText(eingabeIdZuLoeschen);;
|
||||
}
|
||||
|
||||
public void setEingabeNameZuSuchen(String eingabeNameZuSuchen) {
|
||||
this.eingabeNameZuSuchen.setText(eingabeNameZuSuchen);;
|
||||
}
|
||||
|
||||
public void setInsertStudent(JButton insertStudent) {
|
||||
this.insertStudent = insertStudent;
|
||||
}
|
||||
|
||||
public void setUpdateStudent(JButton updateStudent) {
|
||||
this.updateStudent = updateStudent;
|
||||
}
|
||||
|
||||
public void setLoescheStudent(JButton loescheStudent) {
|
||||
this.loescheStudent = loescheStudent;
|
||||
}
|
||||
|
||||
public void setSucheStudent(JButton sucheStudent) {
|
||||
this.sucheStudent = sucheStudent;
|
||||
}
|
||||
|
||||
public void setZeigeAlleStudent(JButton zeigeAlleStudent) {
|
||||
this.zeigeAlleStudent = zeigeAlleStudent;
|
||||
}
|
||||
|
||||
public void setModel(DefaultTableModel model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public void setTable(JTable table) {
|
||||
this.table = table;
|
||||
}
|
||||
|
||||
public void setEingabeGeschlecht(JComboBox eingabeGeschlecht) {
|
||||
this.eingabeGeschlecht = eingabeGeschlecht;
|
||||
}
|
||||
|
||||
public JTextField getEingabeNameZuSuchen() {
|
||||
return eingabeNameZuSuchen;
|
||||
}
|
||||
|
||||
public JButton getInsertStudent() {
|
||||
return insertStudent;
|
||||
}
|
||||
|
||||
public JButton getUpdateStudent() {
|
||||
return updateStudent;
|
||||
}
|
||||
|
||||
public JButton getLoescheStudent() {
|
||||
return loescheStudent;
|
||||
}
|
||||
|
||||
public JButton getSucheStudent() {
|
||||
return sucheStudent;
|
||||
}
|
||||
|
||||
public JButton getZeigeAlleStudent() {
|
||||
return zeigeAlleStudent;
|
||||
}
|
||||
|
||||
public JTable getTable() {
|
||||
return table;
|
||||
}
|
||||
|
||||
public JComboBox getEingabeGeschlecht() {
|
||||
return eingabeGeschlecht;
|
||||
}
|
||||
|
||||
public DefaultTableModel getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package GUIAnwendungen.Timer;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
public class TimerBeispiel {
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package VorlesungsFolien.Verebung;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Mitarbeiter mi = new Mitarbeiter("Müller", "27.10.1972");
|
||||
System.out.println(mi.toString()); // nutzt die von Object geerbte Methode
|
||||
System.out.println(mi.getDetails());
|
||||
|
||||
System.out.println();
|
||||
|
||||
Manager ma = new Manager("Stromberg", "01.02.1970");
|
||||
System.out.println(ma.toString()); // wieder die Methode von Object
|
||||
System.out.println(ma.getDetails());
|
||||
}
|
||||
}
|
||||
|
||||
class Mitarbeiter extends Object {
|
||||
private String name;
|
||||
private double gehalt;
|
||||
private String geburtsdatum;
|
||||
|
||||
public Mitarbeiter(String name, String geburtsdatum) {
|
||||
this(name, 35000, geburtsdatum);
|
||||
}
|
||||
|
||||
public Mitarbeiter(String name, double gehalt, String geburtsdatum) {
|
||||
this.name = name;
|
||||
this.gehalt = gehalt;
|
||||
this.geburtsdatum = geburtsdatum;
|
||||
}
|
||||
|
||||
public String getDetails() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
class Manager extends Mitarbeiter {
|
||||
private String abteilung;
|
||||
|
||||
public Manager(String name, String geburtsdatum) {
|
||||
super(name, 65000, geburtsdatum); // das MUSS gemacht werden!
|
||||
}
|
||||
|
||||
public String getDetails() {
|
||||
return super.getDetails() + " " + abteilung;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue