首页 > 试题广场 >

已知如下说明:TextArea ta = new TextA

[单选题]

已知如下说明:

TextArea ta = new TextArea ("Hello", 5, 5);

请问哪个语句是正确的?( )

  • The maximum number of characters in a line is 5.
  • The displayed height is 5 lines otherwise constrain.
  • The displayed string can use multiple fonts.
  • The displayed strings are editable.
TextArea的一个构造方法为:
TextArea (String  text, int rows, int columns)
          构造一个新文本区,该文本区具有指定的文本,以及指定的行数和列数。
A选项不正确,因为TextArea默认是不带滚动条的,但是超过定义中显示的行数任然可以显示。
B选项正确,因为定义的高度是5行。
C选项不正确,因为没有设置TextArea的字体样式,将会以默认字体显示,则不会有多种字体。
D选项正确,默认的文本可以编辑。
发表于 2017-03-18 00:12:29 回复(0)