I am using lanterna to build a front end for my application and it requires a non-blocking input method so the displayed data can continuously refresh.
for some reason the method for non-blocking input (pollInput) crashes on calling while the blocking method of the same class (readInput) works as intended
https://github.com/CaderHancock/options
while(itsPartyTime)
{ try
{
keyStroke = screen.pollInput();
textGraphics.putString(15,15, keyStroke.toString() );
}catch(Exception e){
textGraphics.putString(15,15, e.getMessage());
}
the above crashes
if the method readInput() is used instead everything works
screen.pollInput() will return null and continue on
So in your loop, most of the time it will be null, which is expected.