|
I used class A to define an interface with a JScrollPane and JTextArea, and set the horizontal scroll bar not to appear, and the vertical scroll bar to appear when necessary. I passed this JTextArea to the construction method of another class B, and then I modified the content of JTextArea in class B. Logically, when the content of JTextArea exceeds the size of the text area, the scroll bar will automatically track to the end of the text, right? , But it doesn’t work in some programs. I have tried it. When I modify the content of JTextArea in class A, the scroll bar can be tracked automatically, but once there is any modification in class B, it won’t work. Why is that? Method to solve? Seniors, please advise! |
|