Backspace works

This commit is contained in:
Arthur 2021-02-17 16:07:01 +01:00
parent d33ab0043a
commit 73ef819bb3

View File

@ -57,13 +57,12 @@ public class Listener implements ActionListener, KeyListener {
frame.changeList(String.valueOf(ke.getKeyChar()), frame.textAreaList.get(index),nbAxioms); frame.changeList(String.valueOf(ke.getKeyChar()), frame.textAreaList.get(index),nbAxioms);
if(ke.getKeyChar() == '\b'){ if(ke.getKeyChar() == '\b'){
String str = frame.textAreaList.get(index).getText(); String str = frame.textAreaList.get(index).getText();
if(str.length()>11) { if(str.length()>10) {
if (!(str.endsWith(";\n") || str.endsWith(";"))){
str = str.substring(10, str.length() - 1); str = str.substring(10, str.length() - 1);
frame.textAreaList.get(index).setText(type + " : \n" + str); frame.textAreaList.get(index).setText(type + " : \n" + str);
} }
else }
frame.textAreaList.get(index).setText(type+" : \n");
} }
} }