|
@ -46,9 +46,9 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
public static JLabel budgetDispaly; |
|
|
public static JLabel budgetDispaly; |
|
|
public static JLabel expensesDisplay; |
|
|
public static JLabel expensesDisplay; |
|
|
public static JLabel balanceDisplay; |
|
|
public static JLabel balanceDisplay; |
|
|
public static int budget; |
|
|
|
|
|
public static int expenses; |
|
|
|
|
|
public static int balance; |
|
|
|
|
|
|
|
|
public static double budget; |
|
|
|
|
|
public static double expenses; |
|
|
|
|
|
public static double balance; |
|
|
public static JTextField textExpensesName; |
|
|
public static JTextField textExpensesName; |
|
|
public static JLabel ausgabenName; |
|
|
public static JLabel ausgabenName; |
|
|
private static JLabel ausgabenBetrag; |
|
|
private static JLabel ausgabenBetrag; |
|
@ -244,20 +244,20 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
leerButton(); |
|
|
leerButton(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
budget = Integer.parseInt(text1.getText()); |
|
|
|
|
|
|
|
|
budget = Double.parseDouble(text1.getText()); |
|
|
if (ae.getSource() == this.senden && (text1 != null && text2 != null)) { |
|
|
if (ae.getSource() == this.senden && (text1 != null && text2 != null)) { |
|
|
budgetDispaly.setText(setBudgetView()); |
|
|
budgetDispaly.setText(setBudgetView()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (ae.getSource() == this.berechne && (text1 != null && text2 != null)) { |
|
|
if (ae.getSource() == this.berechne && (text1 != null && text2 != null)) { |
|
|
expenses = budget - Integer.parseInt(text2.getText()); |
|
|
|
|
|
|
|
|
expenses = budget - Double.parseDouble(text2.getText()); |
|
|
expensesDisplay.setText(setExpensesView()); |
|
|
expensesDisplay.setText(setExpensesView()); |
|
|
balance = Integer.parseInt(text1.getText()) - Integer.parseInt(text2.getText()); |
|
|
|
|
|
|
|
|
balance = Double.parseDouble(text1.getText()) - Double.parseDouble(text2.getText()); |
|
|
balanceDisplay.setText(setBalanceView()); |
|
|
balanceDisplay.setText(setBalanceView()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
DefaultTableModel tab = (DefaultTableModel)myTable.getModel(); |
|
|
DefaultTableModel tab = (DefaultTableModel)myTable.getModel(); |
|
|
tab.addRow(new Object [] {(textExpensesName.getText()) , Integer.parseInt(text2.getText())}); |
|
|
|
|
|
|
|
|
tab.addRow(new Object [] {(textExpensesName.getText()) , Double.parseDouble(text2.getText())}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|