Zurück Button eingefügt
parent
d11cdf6f4c
commit
61c4f47588
|
@ -1,6 +1,5 @@
|
|||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -101,6 +100,10 @@ public class FakturamaGUI {
|
|||
updateTextArea();
|
||||
});
|
||||
|
||||
JButton backButton = new JButton("Zurück");
|
||||
backButton.setBackground(new Color(255, 182, 193)); // Hellrot
|
||||
backButton.addActionListener(e -> updateTextArea());
|
||||
|
||||
panel.add(nameLabel);
|
||||
panel.add(nameField);
|
||||
panel.add(addressLabel);
|
||||
|
@ -111,8 +114,8 @@ public class FakturamaGUI {
|
|||
panel.add(taxExemptBox);
|
||||
panel.add(smallBusinessLabel);
|
||||
panel.add(smallBusinessBox);
|
||||
panel.add(new JLabel());
|
||||
panel.add(addButton);
|
||||
panel.add(backButton);
|
||||
|
||||
showPanel(panel);
|
||||
}
|
||||
|
@ -139,6 +142,10 @@ public class FakturamaGUI {
|
|||
updateTextArea();
|
||||
});
|
||||
|
||||
JButton backButton = new JButton("Zurück");
|
||||
backButton.setBackground(new Color(255, 182, 193)); // Hellrot
|
||||
backButton.addActionListener(e -> updateTextArea());
|
||||
|
||||
panel.add(unitLabel);
|
||||
panel.add(unitField);
|
||||
panel.add(descriptionLabel);
|
||||
|
@ -147,8 +154,8 @@ public class FakturamaGUI {
|
|||
panel.add(netPriceField);
|
||||
panel.add(vatRateLabel);
|
||||
panel.add(vatRateField);
|
||||
panel.add(new JLabel());
|
||||
panel.add(addButton);
|
||||
panel.add(backButton);
|
||||
|
||||
showPanel(panel);
|
||||
}
|
||||
|
@ -163,11 +170,6 @@ public class FakturamaGUI {
|
|||
customerBox.addItem(customer.name);
|
||||
}
|
||||
|
||||
JLabel articlesLabel = new JLabel("Artikel:");
|
||||
JList<String> articlesList = new JList<>(Main.articles.stream().map(a -> a.description).toArray(String[]::new));
|
||||
articlesList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
JScrollPane articlesScrollPane = new JScrollPane(articlesList);
|
||||
|
||||
JLabel dateLabel = new JLabel("Datum:");
|
||||
JTextField dateField = new JTextField();
|
||||
|
||||
|
@ -176,6 +178,11 @@ public class FakturamaGUI {
|
|||
formPanel.add(dateLabel);
|
||||
formPanel.add(dateField);
|
||||
|
||||
JLabel articlesLabel = new JLabel("Artikel:");
|
||||
JList<String> articlesList = new JList<>(Main.articles.stream().map(a -> a.description).toArray(String[]::new));
|
||||
articlesList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
JScrollPane articlesScrollPane = new JScrollPane(articlesList);
|
||||
|
||||
JButton addButton = new JButton("Erstellen");
|
||||
addButton.setBackground(new Color(144, 238, 144)); // Hellgrün
|
||||
addButton.addActionListener(e -> {
|
||||
|
@ -191,10 +198,18 @@ public class FakturamaGUI {
|
|||
updateTextArea();
|
||||
});
|
||||
|
||||
JButton backButton = new JButton("Zurück");
|
||||
backButton.setBackground(new Color(255, 182, 193)); // Hellrot
|
||||
backButton.addActionListener(e -> updateTextArea());
|
||||
|
||||
JPanel buttonPanel = new JPanel(new GridLayout(1, 2));
|
||||
buttonPanel.add(addButton);
|
||||
buttonPanel.add(backButton);
|
||||
|
||||
panel.add(formPanel, BorderLayout.NORTH);
|
||||
panel.add(new JLabel("Artikel auswählen:"), BorderLayout.CENTER);
|
||||
panel.add(articlesLabel, BorderLayout.CENTER);
|
||||
panel.add(articlesScrollPane, BorderLayout.CENTER);
|
||||
panel.add(addButton, BorderLayout.SOUTH);
|
||||
panel.add(buttonPanel, BorderLayout.SOUTH);
|
||||
|
||||
showPanel(panel);
|
||||
}
|
||||
|
@ -221,12 +236,16 @@ public class FakturamaGUI {
|
|||
updateTextArea();
|
||||
});
|
||||
|
||||
JButton backButton = new JButton("Zurück");
|
||||
backButton.setBackground(new Color(255, 182, 193)); // Hellrot
|
||||
backButton.addActionListener(e -> updateTextArea());
|
||||
|
||||
panel.add(offerLabel);
|
||||
panel.add(offerBox);
|
||||
panel.add(dateLabel);
|
||||
panel.add(dateField);
|
||||
panel.add(new JLabel());
|
||||
panel.add(addButton);
|
||||
panel.add(backButton);
|
||||
|
||||
showPanel(panel);
|
||||
}
|
||||
|
@ -254,12 +273,16 @@ public class FakturamaGUI {
|
|||
updateTextArea();
|
||||
});
|
||||
|
||||
JButton backButton = new JButton("Zurück");
|
||||
backButton.setBackground(new Color(255, 182, 193)); // Hellrot
|
||||
backButton.addActionListener(e -> updateTextArea());
|
||||
|
||||
panel.add(orderConfirmationLabel);
|
||||
panel.add(orderConfirmationBox);
|
||||
panel.add(dateLabel);
|
||||
panel.add(dateField);
|
||||
panel.add(new JLabel());
|
||||
panel.add(addButton);
|
||||
panel.add(backButton);
|
||||
|
||||
showPanel(panel);
|
||||
}
|
||||
|
@ -288,19 +311,30 @@ public class FakturamaGUI {
|
|||
updateTextArea();
|
||||
});
|
||||
|
||||
JButton backButton = new JButton("Zurück");
|
||||
backButton.setBackground(new Color(255, 182, 193)); // Hellrot
|
||||
backButton.addActionListener(e -> updateTextArea());
|
||||
|
||||
panel.add(deliveryNoteLabel);
|
||||
panel.add(deliveryNoteBox);
|
||||
panel.add(dateLabel);
|
||||
panel.add(dateField);
|
||||
panel.add(new JLabel());
|
||||
panel.add(addButton);
|
||||
panel.add(backButton);
|
||||
|
||||
showPanel(panel);
|
||||
}
|
||||
|
||||
private void showPanel(JPanel panel) {
|
||||
frame.getContentPane().removeAll();
|
||||
frame.getContentPane().add(panel, BorderLayout.NORTH);
|
||||
frame.getContentPane().add(panel, BorderLayout.CENTER);
|
||||
frame.revalidate();
|
||||
frame.repaint();
|
||||
}
|
||||
|
||||
private void showPanel(JScrollPane scrollPane) {
|
||||
frame.getContentPane().removeAll();
|
||||
frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
|
||||
frame.revalidate();
|
||||
frame.repaint();
|
||||
}
|
||||
|
@ -335,6 +369,7 @@ public class FakturamaGUI {
|
|||
sb.append("Rechnung #").append(invoice.id).append(" - ").append(invoice.deliveryNote.orderConfirmation.offer.customer.name).append(" - ").append(invoice.date).append(" - ").append(invoice.status).append("\n");
|
||||
}
|
||||
textArea.setText(sb.toString());
|
||||
showPanel(new JScrollPane(textArea));
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
Loading…
Reference in New Issue