|
@ -31,6 +31,7 @@ import javax.swing.UIManager; |
|
|
|
|
|
|
|
|
public class MeinGui extends JFrame implements ActionListener { |
|
|
public class MeinGui extends JFrame implements ActionListener { |
|
|
|
|
|
|
|
|
|
|
|
//Variablen Initialisierung |
|
|
private JPanel contentPane; |
|
|
private JPanel contentPane; |
|
|
public static JTextField text1; |
|
|
public static JTextField text1; |
|
|
public static JTextField text2; |
|
|
public static JTextField text2; |
|
@ -55,7 +56,10 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
private static JLabel budgetBetrag; |
|
|
private static JLabel budgetBetrag; |
|
|
private static JTable myTable; |
|
|
private static JTable myTable; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public MeinGui() { |
|
|
public MeinGui() { |
|
|
|
|
|
|
|
|
|
|
|
//Erstellen der GUI |
|
|
setTitle("Budget"); |
|
|
setTitle("Budget"); |
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
setBounds(100, 100, 654, 368); |
|
|
setBounds(100, 100, 654, 368); |
|
@ -65,70 +69,82 @@ public class MeinGui extends JFrame implements ActionListener { |
|
|
setContentPane(contentPane); |
|
|
setContentPane(contentPane); |
|
|
contentPane.setLayout(null); |
|
|
contentPane.setLayout(null); |
|
|
|
|
|
|
|
|
|
|
|
//"Berechne" Button wird erstellt und hinzugefügt |
|
|
this.berechne = new JButton("Berechne"); |
|
|
this.berechne = new JButton("Berechne"); |
|
|
berechne.setBounds(78, 281, 110, 23); |
|
|
berechne.setBounds(78, 281, 110, 23); |
|
|
berechne.setToolTipText(""); |
|
|
berechne.setToolTipText(""); |
|
|
contentPane.add(berechne); |
|
|
contentPane.add(berechne); |
|
|
|
|
|
|
|
|
|
|
|
//"Senden" Button wird erstellt und hinzugefügt |
|
|
this.senden = new JButton("Senden"); |
|
|
this.senden = new JButton("Senden"); |
|
|
senden.setBounds(78, 126, 110, 23); |
|
|
senden.setBounds(78, 126, 110, 23); |
|
|
contentPane.add(senden); |
|
|
contentPane.add(senden); |
|
|
|
|
|
|
|
|
|
|
|
//Textfeld für das Budget wird erstellt und hinzugefügt |
|
|
text1 = new JTextField(); |
|
|
text1 = new JTextField(); |
|
|
text1.setBounds(60, 97, 128, 20); |
|
|
text1.setBounds(60, 97, 128, 20); |
|
|
contentPane.add(text1); |
|
|
contentPane.add(text1); |
|
|
text1.setColumns(10); |
|
|
text1.setColumns(10); |
|
|
|
|
|
|
|
|
|
|
|
//Textfeld für die Ausgaben wird erstellt und hinzugefügt |
|
|
text2 = new JTextField(); |
|
|
text2 = new JTextField(); |
|
|
text2.setBounds(60, 250, 128, 20); |
|
|
text2.setBounds(60, 250, 128, 20); |
|
|
contentPane.add(text2); |
|
|
contentPane.add(text2); |
|
|
text2.setColumns(10); |
|
|
text2.setColumns(10); |
|
|
|
|
|
|
|
|
|
|
|
//Logo der Applikation wird hinzugefügt |
|
|
labelHauptImage = new JLabel(""); |
|
|
labelHauptImage = new JLabel(""); |
|
|
labelHauptImage.setBounds(10, 0, 86, 61); |
|
|
labelHauptImage.setBounds(10, 0, 86, 61); |
|
|
Image image0 = new ImageIcon(this.getClass().getResource("/budgetapp.png")).getImage(); |
|
|
Image image0 = new ImageIcon(this.getClass().getResource("/budgetapp.png")).getImage(); |
|
|
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)); |
|
|
contentPane.add(labelHauptImage); |
|
|
contentPane.add(labelHauptImage); |
|
|
|
|
|
|
|
|
|
|
|
//Einfügen der Textbeschreibung für das Eingabefeld "Budget" |
|
|
JLabel budgetEingeben = new JLabel("Budget eingeben"); |
|
|
JLabel budgetEingeben = new JLabel("Budget eingeben"); |
|
|
budgetEingeben.setBounds(10, 72, 110, 20); |
|
|
|
|
|
|
|
|
budgetEingeben.setBounds(10, 72, 130, 20); |
|
|
budgetEingeben.setFont(new Font("Estrangelo Edessa", Font.BOLD, 14)); |
|
|
budgetEingeben.setFont(new Font("Estrangelo Edessa", Font.BOLD, 14)); |
|
|
contentPane.add(budgetEingeben); |
|
|
contentPane.add(budgetEingeben); |
|
|
|
|
|
|
|
|
|
|
|
//Einfügen der "Budget" Überschrift für die Berechnungstabelle |
|
|
JLabel labelBudget = new JLabel("Budget"); |
|
|
JLabel labelBudget = new JLabel("Budget"); |
|
|
labelBudget.setBounds(255, 8, 46, 14); |
|
|
labelBudget.setBounds(255, 8, 46, 14); |
|
|
contentPane.add(labelBudget); |
|
|
contentPane.add(labelBudget); |
|
|
|
|
|
|
|
|
|
|
|
//Einfügen der "Ausgaben" Überschrift für die Berechnungstabelle |
|
|
JLabel labelExpenses = new JLabel("Expenses"); |
|
|
JLabel labelExpenses = new JLabel("Expenses"); |
|
|
labelExpenses.setBounds(390, 8, 56, 14); |
|
|
labelExpenses.setBounds(390, 8, 56, 14); |
|
|
contentPane.add(labelExpenses); |
|
|
contentPane.add(labelExpenses); |
|
|
|
|
|
|
|
|
|
|
|
//Einfügen der "Restbudget" Überschrift für die Berechnungstabelle |
|
|
JLabel labelBalance = new JLabel("Balance"); |
|
|
JLabel labelBalance = new JLabel("Balance"); |
|
|
labelBalance.setBounds(543, 8, 46, 14); |
|
|
labelBalance.setBounds(543, 8, 46, 14); |
|
|
contentPane.add(labelBalance); |
|
|
contentPane.add(labelBalance); |
|
|
|
|
|
|
|
|
|
|
|
//Einfügen des Images für "Budget" in der Tabelle |
|
|
labelBudgetImage = new JLabel(""); |
|
|
labelBudgetImage = new JLabel(""); |
|
|
labelBudgetImage.setBounds(255, 22, 46, 55); |
|
|
labelBudgetImage.setBounds(255, 22, 46, 55); |
|
|
Image image1 = new ImageIcon(this.getClass().getResource("/money.png")).getImage(); |
|
|
Image image1 = new ImageIcon(this.getClass().getResource("/money.png")).getImage(); |
|
|
labelBudgetImage.setIcon(new ImageIcon(image1)); |
|
|
labelBudgetImage.setIcon(new ImageIcon(image1)); |
|
|
contentPane.add(labelBudgetImage); |
|
|
contentPane.add(labelBudgetImage); |
|
|
|
|
|
|
|
|
|
|
|
//Einfügen des Images für "Ausgaben" in der Tabelle |
|
|
labelExpensesImage = new JLabel(""); |
|
|
labelExpensesImage = new JLabel(""); |
|
|
labelExpensesImage.setBounds(400, 22, 46, 55); |
|
|
labelExpensesImage.setBounds(400, 22, 46, 55); |
|
|
Image image2 = new ImageIcon(this.getClass().getResource("/wings-icon.png")).getImage(); |
|
|
Image image2 = new ImageIcon(this.getClass().getResource("/wings-icon.png")).getImage(); |
|
|
labelExpensesImage.setIcon(new ImageIcon(image2)); |
|
|
labelExpensesImage.setIcon(new ImageIcon(image2)); |
|
|
contentPane.add(labelExpensesImage); |
|
|
contentPane.add(labelExpensesImage); |
|
|
|
|
|
|
|
|
|
|
|
//Einfügen des Images für "Restbudget" in der Tabelle |
|
|
labelBalancetImage = new JLabel("New labelBalance"); |
|
|
labelBalancetImage = new JLabel("New labelBalance"); |
|
|
labelBalancetImage.setBounds(543, 22, 34, 55); |
|
|
labelBalancetImage.setBounds(543, 22, 34, 55); |
|
|
Image image3 = new ImageIcon(this.getClass().getResource("/Money-icon.png")).getImage(); |
|
|
Image image3 = new ImageIcon(this.getClass().getResource("/Money-icon.png")).getImage(); |
|
|
labelBalancetImage.setIcon(new ImageIcon(image3)); |
|
|
labelBalancetImage.setIcon(new ImageIcon(image3)); |
|
|
contentPane.add(labelBalancetImage); |
|
|
contentPane.add(labelBalancetImage); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JLabel budgetAusgeben = new JLabel("Ausgaben"); |
|
|
JLabel budgetAusgeben = new JLabel("Ausgaben"); |
|
|
budgetAusgeben.setBounds(10, 185, 63, 14); |
|
|
|
|
|
|
|
|
budgetAusgeben.setBounds(10, 185, 80, 20); |
|
|
budgetAusgeben.setFont(new Font("Estrangelo Edessa", Font.BOLD, 14)); |
|
|
budgetAusgeben.setFont(new Font("Estrangelo Edessa", Font.BOLD, 14)); |
|
|
contentPane.add(budgetAusgeben); |
|
|
contentPane.add(budgetAusgeben); |
|
|
|
|
|
|
|
|