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