How to limit JTextArea max Rows and Columns?
问题 I am using JTextArea in JScrollPane I want to limit the maximum number of lines possible and the maximum chars in each line. I need that the string will be exactly like on the screen, each line will end with '\n' (if there another line after it) and the user will be able to insert only X lines and Y chars in each line. I tried to limit the lines but I don't know exactly how many lines do I have because of the line wrapping, The line wrapping is starting new line visually on the screen(because