Created
May 29, 2011 17:02
-
-
Save colin-haber/997953 to your computer and use it in GitHub Desktop.
Print Queue Handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void runPrinter() { | |
| new Thread(new Runnable() { | |
| @Override | |
| public void run() { | |
| while (true) { | |
| if (!JConsolePane.this.messages.isEmpty()) { | |
| JConsolePane.this.print(JConsolePane.this.messages.get(0)); | |
| JConsolePane.this.messages.remove(0); | |
| } | |
| } | |
| } | |
| }).start(); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This runs after everything is initialized and is called last in the constructor. All print() methods other than print(Message) add a new Message to messages, an ArrayList of messages. But it seems to not work. See it in context at https://github.com/dgn1nja/JavaCon/blob/master/com/n1nja/javacon/JConsolePane.java