|
@ -13,6 +13,8 @@ import java.awt.event.ActionListener; |
|
|
import javax.swing.ImageIcon; |
|
|
import javax.swing.ImageIcon; |
|
|
import javax.swing.JButton; |
|
|
import javax.swing.JButton; |
|
|
import javax.swing.JLabel; |
|
|
import javax.swing.JLabel; |
|
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
|
|
|
|
import java.awt.Font; |
|
|
import java.awt.Font; |
|
|
import javax.swing.JComboBox; |
|
|
import javax.swing.JComboBox; |
|
|
import javax.swing.JTextArea; |
|
|
import javax.swing.JTextArea; |
|
@ -92,7 +94,7 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
labelHauptImage.setIcon(new ImageIcon(image0)); |
|
|
labelHauptImage.setIcon(new ImageIcon(image0)); |
|
|
|
|
|
|
|
|
labelHauptImage.setFont(new Font("Tahoma", Font.BOLD, 13)); |
|
|
labelHauptImage.setFont(new Font("Tahoma", Font.BOLD, 13)); |
|
|
labelHauptImage.setBounds(10, 8, 86, 61); |
|
|
|
|
|
|
|
|
labelHauptImage.setBounds(10, 0, 86, 61); |
|
|
contentPane.add(labelHauptImage); |
|
|
contentPane.add(labelHauptImage); |
|
|
|
|
|
|
|
|
JLabel budgetEingeben = new JLabel("Budget eingeben"); |
|
|
JLabel budgetEingeben = new JLabel("Budget eingeben"); |
|
@ -192,14 +194,14 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
|
|
|
|
|
|
budget = Integer.parseInt(text1.getText()); |
|
|
budget = Integer.parseInt(text1.getText()); |
|
|
if (ae.getSource() == this.senden && (text1 != null && text2 != null)) { |
|
|
if (ae.getSource() == this.senden && (text1 != null && text2 != null)) { |
|
|
BudgetView(); |
|
|
|
|
|
|
|
|
SetBudgetView(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (ae.getSource() == this.berechne && (text1 != null && text2 != null)) { |
|
|
if (ae.getSource() == this.berechne && (text1 != null && text2 != null)) { |
|
|
expenses = budget - Integer.parseInt(text2.getText()); |
|
|
expenses = budget - Integer.parseInt(text2.getText()); |
|
|
expensesView(); |
|
|
|
|
|
|
|
|
setExpensesView(); |
|
|
balance = Integer.parseInt(text1.getText()) - Integer.parseInt(text2.getText()); |
|
|
balance = Integer.parseInt(text1.getText()) - Integer.parseInt(text2.getText()); |
|
|
balanceView(); |
|
|
|
|
|
|
|
|
setBalanceView(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -216,15 +218,15 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
balanceDisplay.setText(""); |
|
|
balanceDisplay.setText(""); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void BudgetView() { |
|
|
|
|
|
|
|
|
public static void SetBudgetView() { |
|
|
budgetDispaly.setText(budget + " €"); |
|
|
budgetDispaly.setText(budget + " €"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void expensesView() { |
|
|
|
|
|
|
|
|
public static void setExpensesView() { |
|
|
expensesDisplay.setText(expenses - budget + " €"); |
|
|
expensesDisplay.setText(expenses - budget + " €"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void balanceView() { |
|
|
|
|
|
|
|
|
public static void setBalanceView() { |
|
|
balanceDisplay.setText(balance + " €"); |
|
|
balanceDisplay.setText(balance + " €"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|