added swingworker in processkeyevent

This commit is contained in:
Manindra Moharana
2013-08-20 02:30:56 +05:30
parent c8ed546861
commit 01dfe8c344
2 changed files with 13 additions and 6 deletions

View File

@@ -5,5 +5,5 @@ app.library.location=/home/quarkninja/Workspaces/processing-workspace/processing
java.target.version=1.6
lib.name=ExperimentalMode
dist=dist
release=2
prettyVersion=1.1
release=3
prettyVersion=1.1.1

View File

@@ -34,6 +34,7 @@ import java.util.Map;
import javax.swing.DefaultListModel;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import processing.app.syntax.JEditTextArea;
import processing.app.syntax.TextAreaDefaults;
@@ -179,10 +180,16 @@ public class TextArea extends JEditTextArea {
super.processKeyEvent(evt);
if (evt.getID() == KeyEvent.KEY_TYPED) {
errorCheckerService.runManualErrorCheck();
log(" Typing: " + fetchPhrase(evt) + " "
+ (evt.getKeyChar() == KeyEvent.VK_ENTER));
final KeyEvent evt2 = evt;
SwingWorker worker = new SwingWorker() {
protected Object doInBackground() throws Exception {
errorCheckerService.runManualErrorCheck();
log(" Typing: " + fetchPhrase(evt2) + " "
+ (evt2.getKeyChar() == KeyEvent.VK_ENTER));
return null;
}
};
worker.execute();
}