• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Should we consider this also as platform dependent?

 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
yeah, but ... what would PIE do? Especially concerning this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic