GUIs and JavaFX Flashcards
What is a UI?
Definition 1: a user interface is any method or means by which
the end-user interacts with, or controls, a software or hardware
device.
Definition 2: a UI is a communication medium (conduit) that
enables a human to interact with a machine (human-machine
interaction).
What is a GUI (general definition)?
A GUI is a type of user interface through which users interact
with programs or electronic devices via interactive visual
components.
What framework has been most used in this class?
JavaFX.
What is a GUI (definition in terms of UI controls and such)?
A GUI is a container of UI controls (also known as widgets):
What are the main structural components of any JavaFX application?
1) Stage: is the main window where the
application will be displayed.
2) Scene: is a container of UI controls that
composes one “page” of the application.
3) Scene Graph (tree-like data structure):
is a hierarchy of element(s) placed in the
Scene with visual appearance and
interactive behavior.
What is the difference between a stage and a scene (in JavaFX)?
A stage is the top level container class. While a scene holds all the elements of a scene graph.
What is a scene?
➢ The Scene is populated with a tree of Nodes
▪ Layout components
▪ UI Controls
▪ Charts
▪ Shapes
What are the imperative and declarative approaches?
Imperative: coding by hand.
Declarative: using a tool such as scene builder.
Name the 3 type of nodes in a scene graph.
Root node, parent node and terminal node.
Name the upsides and downsides of declarative approach.
Very easy to use, reducing errors. Not as much control and precision over nodes.
Name the upsides and downsides of imperative approach.
Very time consuming and prone to errors. Makes designing the scene graph a very easy process.
What does flow pane do?
Puts all the nodes from left to right along a row, when the row is finished (doesn’t have anymore space for new nodes) it goes down to the next row and puts the nodes from left to right again.
What does tile pane do?
A flow pane with equally sized boxes.
Who is good lookin’?
Victor!!!
Name the 3 Top Level Parent Nodes. And also give information about how they work.
Group, Region and Control.
➢ Group:
▪ Doesn’t perform any positioning of children.
▪ Statically assemble a collection of nodes in fixed positions
▪ Apply an effect or transform to that collection.
➢ Region:
▪ Base class for all general-purpose layout panes
▪ Resizable and styleable via CSS
▪ Supports dynamic layout by sizing and positioning children
➢ Control:
▪ The base class for all skinnable controls
▪ Resizable and subclasses are all stylable via CSS
▪ Controls delegate layout to their skins (which are Regions)
▪ Each layout Control subclass provides API for adding content in the appropriate
place within its skin
▪ You do not add children to a control directly