levo

Graphical User Interface Objects and Events

Containers, panels and laying out a form

  • 3 things to know
  • AS Unit 2

Overview

Container in a graphical interface, layout manager and drawback of absolute positioning with fixed coordinates.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is a container in a graphical interface?

Key term

Give two examples of a container.

Key term

Why group related controls onto a panel?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is a container in a graphical interface?

    Model answer

    A container is a control whose job is to hold other controls, and a container positions and clips the controls placed inside it.

  2. 2

    Give two examples of a container.

    Model answer

    A form and a panel are both containers.

  3. 3

    Why group related controls onto a panel?

    Model answer

    A panel keeps related controls together so the whole group is moved, hidden or disabled with one instruction, and the grouping helps the user read the form.

  4. 4

    What is a layout manager?

    Model answer

    A layout manager is an object that decides where each control sits inside a container and resizes the controls when the container changes size.

  5. 5

    The Java code pnl.setLayout(null); btn.setBounds(20, 40, 100, 30); runs. Describe where the button sits and how big it is.

    Model answer

    The button sits 20 pixels from the left edge and 40 pixels from the top of the panel, and the button measures 100 pixels wide by 30 pixels tall.

  6. 6

    What is the drawback of absolute positioning with fixed coordinates?

    Model answer

    Absolute positioning keeps every control in the same place when the window is resized or the font changes, so controls are clipped or leave empty space.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A null is the of one.
absencepresencetype

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AA null means no value has been recorded.
BZero and an empty string are values.
CA null is the absence of a value.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

An error is the mistake a person made.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Graphical User Interface Objects and Events, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.