File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes grid layout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "grid layout" Watch "grid layout" New topic
Author

grid layout

antraarora
Ranch Hand

Joined: Jul 27, 2000
Posts: 45
Could somebody help me with this? It's from Applied reasoning mock exam?
A panel has grid layout with 2 rows and 2 columns. there is a button in each cell and another button is added to the pnale as follows:-
aPanel.addbutton(new button("Bob")). Where will the new button be placed?
A. row1 col3
B. row1 col1
C. row3 col1
D. row2 col3
E. row2 col2
I marked "A" as the number rows remains the same and columns can be increased. But the correct answer was "E". I am confused???
Surya B
Ranch Hand

Joined: May 10, 2000
Posts: 98
Hi
When you add an additional component to the grid layout an additional column will be added.So in your question by default you have 2 rows 2 columns..so it will be something like
button1 button2
button3 button4
Now when you add an additional button,what happens(???) you will have an addtional column,so now we have 2 rows 3 columns,so now how do you think the buttons will adjust themselves
button1 button2 button3
button4 button5
So whats your answer now
Surya
[This message has been edited by Surya B (edited August 29, 2000).]
antraarora
Ranch Hand

Joined: Jul 27, 2000
Posts: 45
Thanks Surya! That was helpful!
Harry Chawla
Ranch Hand

Joined: Jun 03, 2000
Posts: 97
For GridLayout
No of rows has higher priority and is enforced. If the no of rows is 0, then the no of columns is enforced.
Maybe I'm terse with this one cos' it's mentioned in API and u can try some code to see it in real....
Thanks.
MahaAdd
Greenhorn

Joined: Aug 28, 2000
Posts: 28
Hi,
can u give me the link to this applied reasoning mock test??
thanks..
antraarora
Ranch Hand

Joined: Jul 27, 2000
Posts: 45
It's http://209.242.122.83/JavaCertification.html
goto www.javaranch.com/mock.html to get a list of all the mock exams.
- Antra
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: grid layout