Class SeparateTextGUIThread

java.lang.Object
com.googlecode.lanterna.gui2.AbstractTextGUIThread
com.googlecode.lanterna.gui2.SeparateTextGUIThread
All Implemented Interfaces:
AsynchronousTextGUIThread, TextGUIThread

public class SeparateTextGUIThread extends AbstractTextGUIThread implements AsynchronousTextGUIThread
Default implementation of TextGUIThread, this class runs the GUI event processing on a dedicated thread. The GUI needs to be explicitly started in order for the event processing loop to begin, so you must call start() for this. The GUI thread will stop if stop() is called, the input stream returns EOF or an exception is thrown from inside the event handling loop.

Here is an example of how to use this TextGUIThread:

     
     MultiWindowTextGUI textGUI = new MultiWindowTextGUI(new SeparateTextGUIThread.Factory(), screen);
     // ... add components ...
     ((AsynchronousTextGUIThread)textGUI.getGUIThread()).start();
     // ... this thread will continue while the GUI runs on a separate thread ...
     
 
See Also: