当前位置: 技术问答>java相关
TextArea组件的行数和列数代表什么意思?
来源: 互联网 发布时间:2014-12-28
本文导语: 我将TextArea的列数设置为十,但是,里面可以放上百列的字符,而且,改变其列数后,TextArea的大小不变,为什么? | The rows and columns specified by TextArea/JTextArea and other Java text components ar...
我将TextArea的列数设置为十,但是,里面可以放上百列的字符,而且,改变其列数后,TextArea的大小不变,为什么?
|
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.
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.
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。