|
@ -53,6 +53,7 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
public static double budget; |
|
|
public static double budget; |
|
|
public static double expenses; |
|
|
public static double expenses; |
|
|
public static double balance; |
|
|
public static double balance; |
|
|
|
|
|
public static double erspartes; |
|
|
public static JTextField textExpensesName; |
|
|
public static JTextField textExpensesName; |
|
|
public static JLabel ausgabenName; |
|
|
public static JLabel ausgabenName; |
|
|
private static JLabel ausgabenBetrag; |
|
|
private static JLabel ausgabenBetrag; |
|
@ -269,6 +270,7 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
berechne.addActionListener(this); |
|
|
berechne.addActionListener(this); |
|
|
loeschen.addActionListener(this); |
|
|
loeschen.addActionListener(this); |
|
|
exit.addActionListener(this); |
|
|
exit.addActionListener(this); |
|
|
|
|
|
hinzufuegen.addActionListener(this); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -297,7 +299,27 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
balanceDisplay.setText(setBalanceView()); |
|
|
balanceDisplay.setText(setBalanceView()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ae.getSource() == this.hinzufuegen) { |
|
|
|
|
|
erspartesHinzufuegen(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void erspartesHinzufuegen() { |
|
|
|
|
|
erspartes += (budget - expenses); |
|
|
|
|
|
budget = 0.0; |
|
|
|
|
|
expenses = 0.0; |
|
|
|
|
|
balance = 0.0; |
|
|
|
|
|
text1.setText(null); |
|
|
|
|
|
text2.setText(null); |
|
|
|
|
|
budgetDispaly.setText("0.0 \u20AC"); |
|
|
|
|
|
expensesDisplay.setText("0.0 \u20AC"); |
|
|
|
|
|
balanceDisplay.setText("0.0 \u20AC"); |
|
|
|
|
|
savingsDisplay.setText(Double.toString(erspartes)); |
|
|
|
|
|
textExpensesName.setText(null); |
|
|
|
|
|
((DefaultTableModel) myTable.getModel()).setRowCount(0); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void exitButton() { |
|
|
public static void exitButton() { |
|
|