Parallel string recognizion using Scanner and Thread in Java not working
For a personal project I am working on a way to recognize a String through a JOptionPane. Now my goal is to also have it recognized when I put it in the console as well and then close the JOptionPane. For achieving this I was trying to implement a Thread which was supposed to work parallel. So when the JOptionPane would open also the console should be able to get commands and react to them using a Scanner. However it doesn’t work at all. The Thread is not working parallel to the program but it seems it isn’t reacting.
Parallel string recognition in console and JOptionPane not working despite use of Thread
In another topic I already asked about how to make it that my Java program can recognize a string input parallel either from the console or from a JOptionPane (see here for reference: Parallel string recognition in console and JOptionPane). The comments there told me to use a Thread.
Sadly this went nowhere and after several tries I am completely lost on what to do anymore.