From e32cfa6fe6bf7f2f3bb44381dc3ef147812e2659 Mon Sep 17 00:00:00 2001 From: Arthur <78031901+Arthur7770@users.noreply.github.com> Date: Tue, 16 Feb 2021 17:58:26 +0100 Subject: [PATCH] Adding some changes on the AxiomFieldListener --- src/lsystem/screen/listener/AxiomFieldListener.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lsystem/screen/listener/AxiomFieldListener.java b/src/lsystem/screen/listener/AxiomFieldListener.java index 7cc60b3..2a88999 100644 --- a/src/lsystem/screen/listener/AxiomFieldListener.java +++ b/src/lsystem/screen/listener/AxiomFieldListener.java @@ -19,17 +19,19 @@ public class AxiomFieldListener implements KeyListener { } @Override public void keyTyped(KeyEvent ke) { - if(ke.getKeyCode() != 10) + if(ke.getKeyCode() != KeyEvent.VK_ENTER) frame.changeList(String.valueOf(ke.getKeyChar()),(byte)0, (JTextArea) frame.textAreaList.get(index)); else{ - String str = ";\n"; + String str = ";\r\n"; frame.changeList(str,(byte)0, (JTextArea) frame.textAreaList.get(index)); - frame.textFieldList.get(index).setText(""); + frame.textFieldList.get(index).setText(null); } } @Override public void keyPressed(KeyEvent ke) { + if(ke.getKeyCode() == KeyEvent.VK_ENTER) + frame.textFieldList.get(index).setText(null); } @Override