Exam 2 Flashcards
(133 cards)
PTUI
Plain text user interfaces - command line interfaces
GUI
Graphical user interface - comprised of graphical controls
GUI toolkit used in class
JavaFX
Java’s original GUI toolkit
Abstract Window Toolkit - OS specific. Used heavyweight windows
Java Swing
GUI added in v. 1.2. lightweight and platform-independent.
GUI using JavaFX begins by __ the __ __.
Extending, Application class. Application is abstract.
The ___ is a window in which the JavaFX application runs
Stage
T/F: A stage is used to display a scene
True
T/F: Only one stage can exist at a time.
False. Additional stages show as separate windows. Primary is auto-created with start method
Scenes contain __, which can be __ or __
Single control. Widgets (button, label, text). Pane (container for other controls).
The graphical element that is the building block of a GUI
Control aka node
Control used to display a string of text
Label
JavaFX controls are highly __
Customizable
Some basic modifications to a label
setText(String)
setFont(Font)
setPadding(Insets)
Common stage sets
stage.setTitle(String)
stage.setScene(scene)
stage.show()
Controls can be customized __ and through the use of __
Programmatically. Cascading style sheets (CSS)
Layout
Container in which nodes can be added. Determines where the nodes are, including position and size. Layout is also a node.
Layout that arranges children from left to right
HBox
Layout that arranges children from top to bottom
VBox
To add children to an HBox or VBox
box.getChildren.add(Node)
T/F: HBox and VBox layouts automatically fill in extra space by default
False. Only use space each child needs. Use setMaxHeight(Double.POSITIVE_INFINITY) or width to adjust widgets
A __ method contains code to build some product
Factory. Anything that stays the same between outputs is placed in method. Changing factors in parameters.
Insets
Used to define extra space on the top, bottom, left, and right of something. Can be used within padding setting to achieve.
CornerRadii
Used to round corners on otherwise rectangular shapes