可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Given the following ex


Given the following expression about TextField which use a proportional pitch font.  TextField t = new TextField("they are good",40);     Which statement is true?() 

  • A The displayed string can use multiple fonts.
  • B The maximum number of characters in a line will be 40.
  • C The displayed width is exactly 40 characters.
  • D The user can edit the characters.
参考答案
参考解析:

对于TextField的该种形式的构造函数来说,前一个参数是文本域中初始的字符串的显示值,而后一个是推荐的显示宽度,以列数表示,在构造文本域的时候会将这个大小设置为最佳大小,如果容器的限制使得文本域不能显示这么多也没有办法,一般来说是比这个大小大的,而且即使宽度很小,你也可以在文本域的一行中输入很长的字符串,只有你不使用回车,在超过显示宽度后文本域会自动出现水平滚动条(没有被设置为关闭,缺省是不关闭的),而文本域的缺省编辑方式是可编辑的,一个文本域只能使用一种字体,这个字体可以在运行的过程中动态的改变,但是文本域中的所有字符串都将使用这个字体显示。

分类:SCJP程序员认证考试题库
相关推荐

1、Given the following sc

Given the following scripts, both found in /usr/local/bin, what would the output be when exec...

2、Given the following in

Given the following interface definition, which definitions are valid?()  interface I {  vo...

3、Given the following on

Given the following on a system that is not a name server, which will be the first&e...

4、Given the following co

Given the following code fragment:    public void create() {    Vector myVect;&en...

5、Given the following co

Given the following code:   public class Test { void printValue(int m){ do { System.out...

6、Given the following RM

Given the following RMAN commands,choose the option that reflects the order required to restore&ens...