JavaFX 8 count rows in “textarea”
问题 We are trying to count the number of rows in a TextArea Here are the TextArea properties PrefWidth 600 and PrefHeight 620 with MaxHeight 620 Wrap Text is set to true. We are using JavaFX 8 with Scene Builder We have a textPropertyListiner that will fire an Alert when the TextArea.getLength is greater than some value The issue with this method is it does not consider the user entering a carriage return \n So we implemented this code to capture the \n String toCount = txaDiaryEntry.getText();