Browse Source

Commit_31 Double.parseDouble() _Datentyp_ statt Integer fuer budget, expenses, balance

Mohamed
Adah Boukhari 5 years ago
parent
commit
bafaf150ce
  1. BIN
      Budget Projekt/bin/MeinBudgetView/MeinGui.class
  2. BIN
      Budget Projekt/bin/MeinBudgetView/MyTest.class
  3. 14
      Budget Projekt/src/MeinBudgetView/MeinGui.java

BIN
Budget Projekt/bin/MeinBudgetView/MeinGui.class

BIN
Budget Projekt/bin/MeinBudgetView/MyTest.class

14
Budget Projekt/src/MeinBudgetView/MeinGui.java

@ -46,9 +46,9 @@ public class MeinGui extends JFrame implements ActionListener {
public static JLabel budgetDispaly;
public static JLabel expensesDisplay;
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 JLabel ausgabenName;
private static JLabel ausgabenBetrag;
@ -244,20 +244,20 @@ public class MeinGui extends JFrame implements ActionListener {
leerButton();
}
budget = Integer.parseInt(text1.getText());
budget = Double.parseDouble(text1.getText());
if (ae.getSource() == this.senden && (text1 != null && text2 != null)) {
budgetDispaly.setText(setBudgetView());
}
if (ae.getSource() == this.berechne && (text1 != null && text2 != null)) {
expenses = budget - Integer.parseInt(text2.getText());
expenses = budget - Double.parseDouble(text2.getText());
expensesDisplay.setText(setExpensesView());
balance = Integer.parseInt(text1.getText()) - Integer.parseInt(text2.getText());
balance = Double.parseDouble(text1.getText()) - Double.parseDouble(text2.getText());
balanceDisplay.setText(setBalanceView());
}
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())});
}

Loading…
Cancel
Save