• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TextArea and TextField

 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used search facility here to find out the answer for the following 2 questions. I think, still I am vague and I couldn't get a proper answer. Can anyone get a definite answer for this?(Exam point of view)
QUESTION 1
A TextArea is made in a proportional font like this:

Which are true?
a) It will show exactly 5 rows.
b) It will show exactly 5 columns.
c) Each item can only be 5 letters long.
d) You can edit the contents.
e) You can have multiple fonts inside it.

QUESTION 2
Given a TextField using a proportional pitch font and constructed like this:

Which statement is true?
A. The displayed width shows exactly five characters on each line unless otherwise constrained
B. The maximum number of characters in a line will be five.
C. The user will be able to edit the character string.
E. The displayed string can use multiple fonts.
Thanks.
 
Francisco A Guimaraes
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what�s your doubt on this questions?
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the answers for both questions?
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thiru I have made half of the work for you:

Playing with this code I have seen that is not possible to have more than one font simultaneaously in a TextArea.
By the default you can edit a TextArea.
It is possible to have more than five caracters in a line.
The exact number of rows and columns shown depends on the LayoutManager, but there are at least the especified number in the constructor.
Now Please do the same for the second question and post the results here for others.
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jose. Here is my understanding.
for QUESTION 1
a) It will show exactly 5 rows. //only 4 rows are shown at a time
b) It will show exactly 5 columns. //depends on charater minimum 3 in the case of w and maximum 10 in the case of l
c) Each item can only be 5 letters long. //I don't know what does he meant by item.. but I assume that it is one row. Then it can have any number of charaters(scrollbar appears)
d) You can edit the contents.// of course
e) You can have multiple fonts inside it. //false what happens if i want to show first para in one font and second para in different font? Is it possible?

Will post Textfield after sometime
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jose. Here is my understanding.
for QUESTION 1
a) It will show exactly 5 rows. //only 4 rows are shown at a time
b) It will show exactly 5 columns. //depends on charater minimum 3 in the case of w and maximum 10 in the case of l
c) Each item can only be 5 letters long. //I don't know what does he meant by item.. but I assume that it is one row. Then it can have any number of charaters(scrollbar appears)
d) You can edit the contents.// of course
e) You can have multiple fonts inside it. //false what happens if i want to show first para in one font and second para in different font? Is it possible?

for QUESTION 2
A. The displayed width shows exactly five characters on each line unless otherwise constrained // false 5 W's and 10 l's
B. The maximum number of characters in a line will be five. //false any
C. The user will be able to edit the character string. //YES
E. The displayed string can use multiple fonts.//false
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic