|
@ -28,6 +28,7 @@ import javax.swing.border.MatteBorder; |
|
|
import javax.swing.border.BevelBorder; |
|
|
import javax.swing.border.BevelBorder; |
|
|
import javax.swing.border.TitledBorder; |
|
|
import javax.swing.border.TitledBorder; |
|
|
import javax.swing.UIManager; |
|
|
import javax.swing.UIManager; |
|
|
|
|
|
import static javax.swing.JOptionPane.showMessageDialog; |
|
|
|
|
|
|
|
|
public class MeinGui extends JFrame implements ActionListener { |
|
|
public class MeinGui extends JFrame implements ActionListener { |
|
|
|
|
|
|
|
@ -276,15 +277,23 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void actionPerformed(ActionEvent ae) { |
|
|
public void actionPerformed(ActionEvent ae) { |
|
|
|
|
|
try { |
|
|
|
|
|
budget = Double.parseDouble(text1.getText()); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
showMessageDialog(null, "Sie müssen ihr Budget eingeben!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ae.getSource() == this.exit) { |
|
|
if (ae.getSource() == this.exit) { |
|
|
exitButton(); |
|
|
exitButton(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (ae.getSource() == this.loeschen) { |
|
|
if (ae.getSource() == this.loeschen) { |
|
|
leeren(); |
|
|
leeren(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
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()); |
|
|
} |
|
|
} |
|
@ -307,18 +316,23 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void 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); |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
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); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
showMessageDialog(null, "Sie müssen ihr Budget und ihre Ausgaben eingeben!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|