Forums Register Login

Should we consider this also as platform dependent?

+Pie Number of slices to send: Send
Hello all,
In Jxam, one of the qstns asked say tru/false about 'java.awt.List' related info. The author says the foll is false.

Possible Answer 3:
A vertical scroll bar will be added automatically if needed.

I thought List will have scroll bars if needed, since I have seen in some GUIs. So I checked the SAME example given in Java Doc. In JavaDoc the image shown DOES NOT show scroll bars. But when I tested the same example on Win 98 , JDK 1.2.2, it shows the scroll bars. So what do we say if this kind of qstns come up in the Exam.
Thank you all.
regds
maha anna
Please refer to the online Java Doc here,
<pre>

import java.awt.*;
class mframe extends Frame{
public mframe(){
setLayout(new FlowLayout());
List lst = new List(4, false);
lst.add("Mercury");
lst.add("Venus");
lst.add("Earth");
lst.add("JavaSoft");
lst.add("Mars");
lst.add("Jupiter");
lst.add("Saturn");
lst.add("Uranus");
lst.add("Neptune");
lst.add("Pluto");
add(lst);

setSize(400,300);
setVisible(true);
}
public static void main(String args[]){
new mframe();
}
}

</pre>

[This message has been edited by maha anna (edited April 24, 2000).]
+Pie Number of slices to send: Send

Hi!
The figure in the jdk1.2 api docs is misleading.
The scroll bars should appear otherwise how would you select
other items (i.e. other than the four which are displaying).
However if you increase the # of rows to be displayed in c'tor
the to be more or equal to # of items in the list c'tor
like: <code> List lst = new List(13,false); </code> then
the scrollbar disappears (at least on Solaris X86 2.6).
bongadi
+Pie Number of slices to send: Send

Maha:
If I remember the question correctly, the code given
in the exam doesnot add anything to the list.
It says something like:
List lst = new List(X, false);
Then the answers given are (something like this):
A. multiple items can be selected
B. Max. "X" items are visible.
C. scroll bar is added automatically, if needed
D. Only "X" items can be added to the list.
I think the code does not add any items to the list.
Hence there is no need to add any scroll bar automatically.
I told this to myself and agreed with the author of the exam.
Re your example, I think the scroll bar is added (if needed)
irrespective of the machine it runs. I am on UNIX and it did
add a scroll bar.

Regds.
- satya
Good night. Drive safely. Here's a tiny ad for the road:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 769 times.
Similar Threads
JXam Mock Exam Question
Object Conversion Rules!Pls help me!
I think this qstn from Jxam is suitable for Errata.
Inner
All components inherit menucontainer???
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 01:43:03.