• 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

buttons in card layout

 
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all!
This is from the mock exam at http://www.geocities.com/SiliconValley/Screen/5046/ftest1.html.
The question is:
Which of the following managers can be used to display nine button objects at one time?
1. BorderLayout
2. GridLayout
3. CardLayout
4. GridBagLayout
The "right" answer is 2&4.
I don't see why a CardLayout card could not have nine buttons on it. Could anyone please explain?
Thanks in advance.
Stephanie
 
Ranch Hand
Posts: 477
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>I don't see why a CardLayout card could not have nine buttons
>on it. Could anyone please explain?
The API says...
A CardLayout object is a layout manager for a container. It treats each component in the container as a card. Only one card is visible at a time, and the container acts as a stack of cards. The first component added to a CardLayout object is the visible component when the container is first displayed.
First button isn�t a container so you can add a button directly to a CardLayout. Second a CardLayout show one element at a time (like a Tabbed Panel, when you select Tools-Options in Word!) and this element must be a Container like Panel, then, in that Panel you can specify a FlowLayout for placing the 9 buttons.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic