WEEK 6 - GUI DEV Flashcards
What are the two purposes of a user interface?
- Allows user to provide input to the application
- Allows application to provide output to the user
What does GUI mean?
Graphical user interface.
What is the standard Java GUI framework for standalone applications?
JavaFX.
What are some of the JavaFX API classes (and packages) under the JavaFX top-level package?
Scene, Stage, Pane, Control, Button, ComboBox, TextField etc
What is the basic structure of JavaFX?
The abstract javafx.application.Application class defines the essential framework for writing JavaFX programs.
Every JavaFX program is defined in a class that extends javafx.application.Application.
What is Stage?
A window for holding other GUI elements
What is Scene?
A container for content shown on a stage.
What is Node?
Top-level superclass for things that can appear in a scene (controls, images etc.).
What is control?
A GUI object like a button that the user can see and
interact with (called a “widget” in other GUI platforms). It is a specific kind of node.
What are classes on the left, classes on the right and the black diamond?
Left is top-level superclasses, and classes moving right are subclasses. The black diamond means that the class is composed of object(s) of another class.
What are the two main ways to use JavaFX class in your code?
- Create objects of the JavaFX class. This is often done for standard controls like buttons.
- Create a subclass from the JavaFX class, then create one or more objects of your subclass.
What are some frequently used UI controls?
Label, Button, CheckBox, RadioButton, TextField, PasswordField, TextArea, ComboBox, ListView, ScrollBar, Slider, and MediaPlayer.
What is a label?
A label is a display area for a short text, a node, or both. It is often used to label other controls (usually text fields). Labels and buttons share many common properties. These common properties are defined in the Labeled class.
What is ButtonBase and Button?
A button is a control that triggers an action event when clicked. JavaFX provides regular buttons, toggle buttons, check box buttons, and radio buttons. The common features of these buttons are defined in ButtonBase and Labeled classes.
What is CheckBox?
A CheckBox is used for the user to make a selection. Like Button, CheckBox inherits all the properties such as onAction, text, graphic, alignment, graphicTextGap, textFill, contentDisplay from ButtonBase and Labeled.
What is RadioButton?
Radio buttons, also known as option buttons, enable you to choose a single item from a group of choices. In appearance radio buttons resemble check boxes, but check boxes display a square that is either checked or blank, whereas radio buttons display a circle that is either filled (if selected) or blank (if not selected).
What is TextField?
A text field can be used to enter or display a string. TextField is a subclass of TextInputControl.
What is TextArea?
enables the user to enter multiple lines of text.
What is ComboBox?
A combo box, also known as a choice list or drop-down list, contains a list of items from which the user can choose.
What is ListView?
A list view is a component that performs basically the same function as a combo box, but it enables the user to choose a single value or multiple values.
What is a ScrollBar?
A scroll bar is a control that enables the user to select from a range of values. The scrollbar appears in two styles: horizontal and vertical.
What are some properties of a scrollbar?
Min and Max values, left and right buttons, track and thumb.
What is a slider?
Slider is similar to ScrollBar, but Slider has more
properties and can appear in many forms.
What is Media?
You can use the Media class to obtain the source of the media, the MediaPlayer class to play and control the media, and the MediaView class to display the video.
What is the MediaPlayer class?
The MediaPlayer class plays and controls the media with properties such as autoPlay, currentCount, cycleCount, mute, volume, and totalDuration.
What is the MediaView subclass?
The MediaView class is a subclass of Node that provides a view of the Media being played by a MediaPlayer. The MediaView class provides the properties for viewing the media.
What happens after your start/initialize method displays the main JavaFX window (stage)?
The start method returns and no other methods you
wrote will run (unless “something” happens).
When does a GUI do something?
Normally your GUI program does nothing unless the
user clicks a button or does some other action that
triggers an event.