This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes BorderLayout 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 "BorderLayout" Watch "BorderLayout" New topic
Author

BorderLayout

josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
1. public LayoutApplet ( ) {
2. setLayout(new BorderLayout());
3. setFont(new Font("Serif", Font.PLAIN, 14));
4. add(BorderLayout.NORTH, new Button("North"));
5. add(BorderLayout.SOUTH, new Button("South"));
6. add("East", new Button("East"));
7. add("West", new Button("West"));
8. add(new Button("Center"));
9. }

a) Five push buttons are drawn, with the largest push button in the center. ???
largest is center one becoz of the word "center" which is
six letter word .So appears slightly larger than others

b) There is a compile error on line 8: the location specification via a String or Constant is not provided. //f

c) There is a compile error on line 6: you cannot mix the use of Strings and Constants to specify the location of components.//f

d) Statement 2 is ignored and the default Layout Manager for an Applet is used. //f

josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
please help me with this one ???
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
You can check your answer yourself by compiling and running the program. You'll need to add some stuff, since this seems to be just the constructor. How about:

I used a Frame instead of an Applet because that's what I'm more familiar with - it shouldn't make a difference in the answer.

"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BorderLayout
 
Similar Threads
IBM's exam questions
layout managers
LayoutManager
Flow layout
Abhilash #39 - layout managers