I am trying to highlight a word in JavaFX that is found by Matcher and whenever new one is one I want to highlighted that new one. Is this possible? Here is my code:
                String s1 = displayArea.getText();
                String s2 = textInputArea.getText();
                Pattern p = Pattern.compile("[a-zA-Z]*[^\\s]");            
                Matcher m1 = p.matcher(s1);
                Matcher m2 = p.matcher(s2);
                int counter=0;
                System.out.println("Words from string \"" + s1 + "\" : ");
                while (m1.find() && m2.find() ) {
                    System.out.println("Found words: "+m1.group()+ " Typed words: "+m2.group() );
                    //m1.group() needs to be highlighted and displayed in textarea
                    if (m1.group().equals(m2.group())){
                        counter++;
                        System.out.println("counter:"+counter );
                    }else if (!(m1.group().equals(m2.group())) && typedKey==' '){
                            negativni++;
                            System.out.println("negativni:"+ negativni );
                    }
                }