• 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

LayoutManager

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.......
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the 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