*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes TextArea and TextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "TextArea and TextField" Watch "TextArea and TextField" New topic
Author

TextArea and TextField

Thiru Thangavelu
Ranch Hand

Joined: Aug 29, 2001
Posts: 219
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.


Thanks,<br />Thiru<br />[SCJP,SCWCD,SCBCD]
Francisco A Guimaraes
Ranch Hand

Joined: Mar 20, 2002
Posts: 182
what�s your doubt on this questions?


Francisco<br />SCJP<br />please use the [code][/code] tags when showing code.Click <a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=ubb_code_page" target="_blank" rel="nofollow">here</a> to see an example.
Thiru Thangavelu
Ranch Hand

Joined: Aug 29, 2001
Posts: 219
What are the answers for both questions?
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
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.


SCJP2. Please Indent your code using UBB Code
Thiru Thangavelu
Ranch Hand

Joined: Aug 29, 2001
Posts: 219
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

Joined: Aug 29, 2001
Posts: 219
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: TextArea and TextField
 
Similar Threads
TextArea
TextArea
Exam Question
Strange show
AWT