Deleting Listener.

This commit is contained in:
Arthur 2021-02-17 10:40:39 +01:00
parent 80ea9ae5f0
commit 2c52427f88

View File

@ -1,40 +0,0 @@
package lsystem.screen.listener;
import lsystem.screen.MainFrame;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class AxiomFieldListener implements KeyListener {
private MainFrame frame;
private int index;
public AxiomFieldListener(MainFrame frame,int index){
this.frame = frame;
this.index = index;
}
@Override
public void keyTyped(KeyEvent ke) {
if(ke.getKeyCode() != KeyEvent.VK_ENTER)
frame.changeList(String.valueOf(ke.getKeyChar()),(byte)0, (JTextArea) frame.textAreaList.get(index));
else{
String str = ";\r\n";
frame.changeList(str,(byte)0, (JTextArea) frame.textAreaList.get(index));
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
public void keyReleased(KeyEvent ke) {
}
}