Browse Source

alles von vorne

Eduard2
eduardD 5 years ago
parent
commit
ae6d962d10
  1. 25
      Budget Projekt/src/MeinBudgetView/MeinGui.java

25
Budget Projekt/src/MeinBudgetView/MeinGui.java

@ -20,14 +20,6 @@ import javax.swing.JComboBox;
import javax.swing.JTextArea; import javax.swing.JTextArea;
import java.awt.Color; import java.awt.Color;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.border.EtchedBorder;
import javax.swing.border.MatteBorder;
import javax.swing.border.BevelBorder;
import javax.swing.border.TitledBorder;
import javax.swing.UIManager;
public class MeinGui extends JFrame implements ActionListener { public class MeinGui extends JFrame implements ActionListener {
@ -39,7 +31,7 @@ public class MeinGui extends JFrame implements ActionListener {
JLabel labelBalancetImage; JLabel labelBalancetImage;
JLabel labelHauptImage; JLabel labelHauptImage;
JButton senden; JButton senden;
JButton hinzufügen;
JButton berechne;
JLabel leeren; JLabel leeren;
JButton loeschen; JButton loeschen;
JButton exit; JButton exit;
@ -76,10 +68,10 @@ public class MeinGui extends JFrame implements ActionListener {
setContentPane(contentPane); setContentPane(contentPane);
contentPane.setLayout(null); contentPane.setLayout(null);
this.hinzufügen = new JButton("Hinzufügen");
hinzufügen.setToolTipText("");
hinzufügen.setBounds(78, 281, 110, 23);
contentPane.add(hinzufügen);
this.berechne = new JButton("Berechne");
berechne.setToolTipText("");
berechne.setBounds(78, 281, 110, 23);
contentPane.add(berechne);
this.senden = new JButton("Senden"); this.senden = new JButton("Senden");
senden.setBounds(78, 126, 110, 23); senden.setBounds(78, 126, 110, 23);
@ -188,7 +180,7 @@ public class MeinGui extends JFrame implements ActionListener {
text1.addActionListener(this); text1.addActionListener(this);
text2.addActionListener(this); text2.addActionListener(this);
senden.addActionListener(this); senden.addActionListener(this);
hinzufügen.addActionListener(this);
berechne.addActionListener(this);
loeschen.addActionListener(this); loeschen.addActionListener(this);
exit.addActionListener(this); exit.addActionListener(this);
@ -209,9 +201,8 @@ public class MeinGui extends JFrame implements ActionListener {
budgetDispaly.setText(setBudgetView()); budgetDispaly.setText(setBudgetView());
} }
if (ae.getSource() == this.hinzufügen && (text1 != null && text2 != null)) {
int temp = Integer.parseInt(text2.getText());
Calculations.setExpense(Calculations.getBudget() - temp);
if (ae.getSource() == this.berechne && (text1 != null && text2 != null)) {
Calculations.setExpense(Calculations.getBudget() - Integer.parseInt(text2.getText()));
expensesDisplay.setText(setExpensesView()); expensesDisplay.setText(setExpensesView());
Calculations.setBalance(Integer.parseInt(text1.getText()) - Integer.parseInt(text2.getText())) ; Calculations.setBalance(Integer.parseInt(text1.getText()) - Integer.parseInt(text2.getText())) ;
balanceDisplay.setText(setBalanceView()); balanceDisplay.setText(setBalanceView());

Loading…
Cancel
Save