This commit is contained in:
Arthur 2021-04-13 16:14:11 +02:00
parent c2dd060140
commit 97925fd331
2 changed files with 5 additions and 6 deletions

View File

@ -25,6 +25,7 @@ public class Listener implements ActionListener, KeyListener, MouseWheelListener
this.frame = frame;
this.index = index;
this.type = type;
System.getProperty("os.name");
}
@Override
@ -149,9 +150,9 @@ public class Listener implements ActionListener, KeyListener, MouseWheelListener
byte i = (byte) ((type.equals("Axiome")) ? 0 : 1);
if(nbAxioms==0 && ke.getKeyCode() != KeyEvent.VK_BACK_SPACE)
if(nbAxioms==0 && ke.getKeyChar() != '\b')
tab.changeList(String.valueOf(ke.getKeyChar()), tab.getTextArea(i),nbAxioms);
if(ke.getKeyCode() == KeyEvent.VK_BACK_SPACE){
if(ke.getKeyChar() == '\b'){
String str = tab.getTextArea(i).getText();
if(str.length()>10) {
if (!(str.endsWith(";\n") || str.endsWith(";"))){

View File

@ -19,6 +19,8 @@ public class Tab extends JPanel{
this.nbRules = nbRules;
this.nbTabs = nbTabs;
this.add(new JButton("Close"));
axiomList = textArea("Axiome : \n",nbTabs);
rulesList = textArea("Règles : \n",nbTabs+10);
@ -70,10 +72,6 @@ public class Tab extends JPanel{
this.add(aboveComponents);
this.add(southComponents2);
this.setLayout(new BoxLayout(this,1));
this.add(new JButton("Close"));
tabs.addTab("Génération"+String.valueOf(nbTabs),this);
}