Create Software Components 

Using Java Level 2

 

 

Course Info

Scheme

Resources

Tutorials

Java Demos

Utilities

Links


 

    Quiz 10

Layout Managers

There are 20 questions

Question 1.         

The function of a layout manager is to

(a)   organized classes into packages  

(b)   organize components in a container

(c)   organize the display of a Web page

(d)   organize the files in your project

Question 2.         

A layout manager holds components while a container organizes components.

(a)   true  

(b)   false

Question 3.         

Which layout manager works by positioning components in rows and columns?  

(a)   BorderLayout

(b)   FlowLayout

(c)   GridLayout

(d)   BoxLayout  

Question 4.         

Which layout manager works by positioning components in rows starting from the top-left corner of the container?  

(a)   BorderLayout

(b)   FlowLayout

(c)   GridLayout

(d)   BoxLayout  

Question 5.         

Which layout manager works by organising components into five areas, North, South, East, West and Center?  

(a)   BorderLayout

(b)   FlowLayout

(c)   GridLayout

(d)   BoxLayout  

Question 6.         

Which layout manager works by allowing you to place components in a single row or a single column?  

(a)   BorderLayout

(b)   FlowLayout

(c)   GridLayout

(d)   BoxLayout  

Question 7.         

How do you suggest where a component will be positioned using FlowLayout?

(a)   Assign a row/column reference

(b)   Use NORTH, SOUTH, EAST, WEST, CENTER parameters.  

(c)   Use the .LEFT, .CENTER, .RIGHT parameters.

(d)   You cannot

Question 8.         

Which layout manager is the default manager for a JApplet content pane?

 

______________________

Question 9.         

Which layout manager is the default manager for an JPanel?

 

______________________

Question 10.         

How many components can be added to a region in a BorderLayout?

 

______________________

Question 11.         

How many components can be added in total to a container with a BorderLayout?

 

______________________

Question 12.         

A component added to a container with a BorderLayout expands in size to fill the BorderLayout region.

 

(a)   true

(b)   false

Question 13.         

A component added to a container with a GridLayout expands in size to fill the GridLayout region.

 

(a)   true

(b)   false

Question 14.         

A component added to a container with a FlowLayout expands in size to fill the FlowLayout region.

 

(a)   true

(b)   false

Question 15.         

Which of the following layout managers sizes all contained components to exactly the same width and height.

(a)   BorderLayout

(b)   FlowLayout

(c)   GridLayout

(d)   BoxLayout  

Question 16.         

Which of the following layout managers has a central region that expands if you resize the container.

(a)   BorderLayout

(b)   FlowLayout

(c)   GridLayout

(d)   BoxLayout  

Question 17.         

How do you change the current layout manager for a container?

(a)   Use the setLayout method

(b)   Use the New Layout method

(c)   Use the Update Layout method

(d)   You cannot

Question 18.         

The default layout for an applet is BorderLayout.   Write down an expression to to change the layout of an applets content pane to  FlowLayout with center alignment.

 

_________________________________________________

Question 19.         

The default layout for an panel is FlowLayout. Write down an expression to set the layout of a panel called mainPanel to BorderLayout.

 

_________________________________________________

Question 20.         

Write down an expression to add a swing button to the north region of a panel with a BorderLayout. Assume the button is called bt and the panel is call mainPanel.

 

_________________________________________________

 

        

 

  Site Home 

Java Home   

  Forum  

Course Info

Welcome

Overview

Assessment

Qualification

Scheme of Work

Assignments

Resources

Information

Blackboard

Learning Center

Web Materials

Reading

Java Demos

Utilities

Links

Lecture Materials

Tutorials & Notes

Exercises

Activities

Quizzes

 

Site Home

Top

Unit Home

ADR 2002