From bafaf150ce2699e9dae9c98662ccf2610523ae3d Mon Sep 17 00:00:00 2001 From: Adah Boukhari Date: Tue, 4 Feb 2020 14:17:36 +0100 Subject: [PATCH] Commit_31 Double.parseDouble() _Datentyp_ statt Integer fuer budget, expenses, balance --- .../bin/MeinBudgetView/MeinGui.class | Bin 7392 -> 7393 bytes .../bin/MeinBudgetView/MyTest.class | Bin 1681 -> 1690 bytes .../src/MeinBudgetView/MeinGui.java | 14 +++++++------- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Budget Projekt/bin/MeinBudgetView/MeinGui.class b/Budget Projekt/bin/MeinBudgetView/MeinGui.class index aed0cd413845fd746515045fddbda262be157ba4..40d8b3c679c6f3d57a0a52270350df741331c1fa 100644 GIT binary patch delta 156 zcmaE0`OtF1Tt-Hh&GQ&naH|VsC6*=X=OpH(>$~KaCgr5^FxoRZFfwo#Bo-B?LWCF@ zL?<8M7h!an+`#)wR8+%7(+6GGeX2~MP^vP;ca*XMl rU8PzX8CfQumJShOV_;-pV36I-m>0Q;(Q^}{WBO!68F!#$rA#^iX=X2e delta 159 zcmaE8`M`3+Tt-IE&GQ&naH|StC6*=X=OpH(>wD&vq^749@i5vmIxsSD6eJcErvk+o z8AK-^Z85x-;pOFp`VqsupU|^8l&6pRtiP3WtqhreCo6?GtgJsl!3aVt%0SHwv>i_@% diff --git a/Budget Projekt/bin/MeinBudgetView/MyTest.class b/Budget Projekt/bin/MeinBudgetView/MyTest.class index 93f2812283953a9d8a46ff8140f6b3eb4e14bcdf..8fbbecae7994a5c84533a7c7164ce777751abd0a 100644 GIT binary patch delta 231 zcmbQpJByd=)W2Q(7#JAL7(zC3nKLrFOm$^Kw6k2PLkHv>d_EkuzoP^;MF&#dk& lA`Ai9lWo|{`)W2Q(7#JAL7=ku(nKLqaPIh9{WAxly$hezPUob1NEKxrvF)v-;Gp{5y zJ++93L6*UjkwHwuQ_}}Sa&jcI>E!9m^^DAu#aZq@AQ-uc!G05iaLNt_ z$?XjCLQ2~hRJJi_>|k)(!JrS9as~6vk(5v7W|Nv+z{hz;%9|X(COLTu ws{`jw28d17lkc*oFtKJ#c4ae@uVPST;09XH19n6;kmd#Q7#RY9Bojj*0K)w~hX4Qo diff --git a/Budget Projekt/src/MeinBudgetView/MeinGui.java b/Budget Projekt/src/MeinBudgetView/MeinGui.java index f690b85..d3afd18 100644 --- a/Budget Projekt/src/MeinBudgetView/MeinGui.java +++ b/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())}); }