Browse Source

Commit_44 (klicke L um die Eintraege zu leeren) KeyListener

Mohamed
Adah Boukhari 5 years ago
parent
commit
adb2019f0f
  1. BIN
      Budget Projekt/bin/MeinBudgetView/MeinGui.class
  2. 23
      Budget Projekt/src/MeinBudgetView/MeinGui.java
  3. 3
      Command.txt

BIN
Budget Projekt/bin/MeinBudgetView/MeinGui.class

23
Budget Projekt/src/MeinBudgetView/MeinGui.java

@ -257,12 +257,12 @@ public class MeinGui extends JFrame implements ActionListener, KeyListener {
} }
public static void leeren() { public static void leeren() {
text1.setText(null);
text2.setText(null);
budgetDispaly.setText(null);
expensesDisplay.setText(null);
balanceDisplay.setText(null);
textExpensesName.setText(null);
text1.setText("");
text2.setText("");
budgetDispaly.setText("0.0 €");
expensesDisplay.setText("0.0 €");
balanceDisplay.setText("0.0 €");
textExpensesName.setText("");
((DefaultTableModel) myTable.getModel()).setRowCount(0); ((DefaultTableModel) myTable.getModel()).setRowCount(0);
} }
@ -283,19 +283,14 @@ public class MeinGui extends JFrame implements ActionListener, KeyListener {
@Override @Override
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
// TODO Auto-generated method stub
} }
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
if (text1.getText().length() > 0) {
budgetDispaly.setText(setBudgetView());
} else {
JOptionPane.showMessageDialog(text1, "Füllen Sie alle Felder aus!");
}
if (e.getKeyCode() == KeyEvent.VK_L) {
leeren();
} }
} }

3
Command.txt

@ -0,0 +1,3 @@
Befehle:
L: Alle Einträge leeren
Loading…
Cancel
Save