可能是他的显示大小是多少行和和多少列吧!

解决方案 »

  1.   

    The rows and columns specified by TextArea/JTextArea and other Java text components are used for the visual layout (the physical dimensions of the visual display) of a component, not the logical setup of its content. The number of rows and columns specified in the constructor or set via setter methods do not correlate to the number of letters in a given line (the use of non-fixed-width fonts makes this virtually impossible). The only way to gain this sort of functionality would be to override the Document model of JTextComponents, but even this would be a challenge as most text components rely on a more human-centric model based on character and paragraph attributes rather than on an x-y character grid. Overriding awt.TextArea would be a near-impossibility.