CCEA A-Level Software Systems Development CL4
Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures
Exception Handling and Managing Input and Output
Testing an Object Oriented Application
Graphical User Interface Objects and Events
Multiple Forms and Linking to Files
Designing, Testing and Evaluating an Event Driven Application
Reasons for Systems Development and Systems Methodologies
Managing Projects
Testing Strategies
Database Concepts and Entity Relationship Modelling
Normalisation and Structured Query Language
Project Management and the Systems Approach in Practice
Defining Requirements and Documenting the Design
Building a Desktop Solution with a Database
Testing and Evaluating the Solution
Multiple Forms and Linking to Files
Creating, showing, hiding and closing a form
- 3 things to know
- AS Unit 2
Overview
Creating an instance and showing it, the difference between hiding a form and disposing of it, what happens to the values in its controls either way, and why a secondary window must not close the whole application.
What you need to know
Answer each one before you reveal it.
What two steps are needed to implement a second form on the screen in code?
The Java code FrmReport f = new FrmReport(); f.setVisible(true); runs in a handler and the button is clicked twice. How many report windows appear?
Questions from this subtopic
Each one with the model answer underneath.
- 1
What two steps are needed to implement a second form on the screen in code?
Model answer
An instance of the second form's class is created, and the new form's visible property is then set to true.
- 2
The Java code FrmReport f = new FrmReport(); f.setVisible(true); runs in a handler and the button is clicked twice. How many report windows appear?
Model answer
Two report windows appear, because each click creates a fresh instance and shows it, and neither instance knows about the other.
- 3
How would a developer make sure only one copy of a form is ever open?
Model answer
The application keeps a reference to the form and only creates a new instance when that reference is empty, otherwise the existing window is brought to the front.
- 4
What is the difference between hiding a form and closing it?
Model answer
A hidden form still exists in memory with all its values intact, while a closed form is destroyed and its controls and their contents are gone.
- 5
A form's text boxes are filled in, the form is hidden with setVisible(false), and it is later shown again. What do the text boxes contain?
Model answer
The text boxes still contain the values the user typed, because hiding only stops the form being drawn and the object was never destroyed.
- 6
A form's text boxes are filled in and the form is closed with dispose(), then a new instance is created and shown. What do the text boxes contain?
Model answer
The text boxes are empty, because dispose destroyed the old window and the new instance built fresh controls holding their default values.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Multiple Forms and Linking to Files, 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.