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 LayoutManager 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 "LayoutManager" Watch "LayoutManager" New topic
Author

LayoutManager

josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
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. }

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

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

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

d) Five push buttons are drawn, with the largest push button in the center. //t

e) The code compiles successfully //t

josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
Statement 2 is ignored and the default Layout Manager for an Applet is used. //f
b) There is a compile error on line 6: you cannot mix the use of Strings and Constants to specify the location of components. //f
c) There is a compile error on line 8: the location specification via a String or Constant is not provided. //f
d) Five push buttons are drawn, with the largest push button in the center. //f
e) The code compiles successfully //t
add(BorderLayout.NORTH, new Button("North"));
add(new Button("North"),BorderLayout.NORTH);
add("North", new Button("North"));
are same.......
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: LayoutManager