Txt Dateien müssen nicht mehr manuell erstellt werden. (Bemerkung für
Protokoll: Die KI benötigt sehr lange den Code wiederzugeben, und trotz des Prompts, das UI moderner zu gestalten ändert sich in der Umsetzung nichts.)master
parent
69ba157b30
commit
509adb1ac3
|
@ -94,6 +94,17 @@ public class Warenwirtschaftssystem {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkAndCreateFile(String fileName) {
|
||||||
|
File file = new File(fileName);
|
||||||
|
if (!file.exists()) {
|
||||||
|
try {
|
||||||
|
file.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void showCreateUserDialog() {
|
private void showCreateUserDialog() {
|
||||||
JPanel createUserPanel = new JPanel(new GridLayout(4, 2, 10, 10));
|
JPanel createUserPanel = new JPanel(new GridLayout(4, 2, 10, 10));
|
||||||
createUserPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Neuen Benutzer erstellen", TitledBorder.CENTER, TitledBorder.TOP));
|
createUserPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Neuen Benutzer erstellen", TitledBorder.CENTER, TitledBorder.TOP));
|
||||||
|
@ -129,7 +140,7 @@ public class Warenwirtschaftssystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeMainComponents() {
|
private void initializeMainComponents() {
|
||||||
frame = new JFrame("Warenwirtschaftssystem");
|
frame = new JFrame("Warenwirtschaftssystem");
|
||||||
frame.setSize(1200, 800);
|
frame.setSize(1200, 800);
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
|
@ -137,6 +148,13 @@ public class Warenwirtschaftssystem {
|
||||||
mainPanel.setLayout(new BorderLayout());
|
mainPanel.setLayout(new BorderLayout());
|
||||||
mainPanel.setBackground(Color.decode("#F5F5F5"));
|
mainPanel.setBackground(Color.decode("#F5F5F5"));
|
||||||
|
|
||||||
|
// Überprüfen und Erstellen der Dateien
|
||||||
|
checkAndCreateFile("products.txt");
|
||||||
|
checkAndCreateFile("suppliers.txt");
|
||||||
|
checkAndCreateFile("orders.txt");
|
||||||
|
checkAndCreateFile("customers.txt");
|
||||||
|
checkAndCreateFile("employees.txt");
|
||||||
|
checkAndCreateFile("users.txt");
|
||||||
// Menüleiste erstellen
|
// Menüleiste erstellen
|
||||||
menuBar = new JMenuBar();
|
menuBar = new JMenuBar();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue