Test01 Flashcards
On a Web page, the ________ specifies what information to display and the ________ specifies how that information should be displayed.
- HTML, CSS
- CSS, HTML
- HTML, JavaFX
- code,CSS
HTML, CSS
In the hexadecimal color value #CCAA99, the CC refers to which color component?
- yellow
- blue
- green
- red
- Red (redred,greengreen,blueblue)
In order to preserve an image’s aspect ratio (so it does not appear stretched or distorted), you should use which of the following? Assume myView references an ImageView object.
- myView.setPreserveRatio();
- myView.setPreserveRatio(true);
- myView.setPreserveRatio(false)
- Either A or C would work
- myView.setPreserveRatio(true);
In order to leave 15 pixels of space in an HBox container, use which of the following statements?
- myhbox.setPadding(new Insets(15));
- myhbox.setPadding.Insets(15);
- myhbox.setPadding(15);
- myhbox = setPadding(15);
- myhbox.setPadding(new Insets(15));
In memory, GUI objects in a ________ are organized as ________ in a tree-like hierarchical data structure.
- scene graph, nodes
- scene, nodes
- scene graph, methods
- node, scenes
- scene, nodes
In a JavaFX application, you must recompile the application each time you make a change to the stylesheet.
True
False
False
In a JavaFX application, you are limited to a single layout container since layout containers cannot be nested.
True
False
False
In a JavaFX application, a CSS type selector corresponds to a specific JavaFX node.
True
False
True
If you set a scene’s size to a width and height that is smaller than the width and height of the image to be displayed,
- the scene will automatically be resized to fit the image
- only part of the image will be displayed
- the image will automatically be resized to fit the window
- the image will only occupy part of the window
- Only part of the image will be displayed
If you have two RadioButtons ( dogRadio and catRadio), how should you code them to create a mutually exclusive relationship?
- dogRadio.setToggleGroup();
catRadio.setToggleGroup(); - ToggleGroup radioGroup = new ToggleGroup();
dogRadio.setToggleGroup(radioGroup);
catRadio.setToggleGroup(radioGroup); - ToggleGroup dogRadio = new ToggleGroup();
ToggleGroup catRadio = new ToggleGroup(); - ToggleGroup radioGroup = new radioGroup();
dogRadio.setToggle(radioGroup);
catRadio.setToggle(radioGroup);
- ToggleGroup radioGroup = new ToggleGroup();
dogRadio.setToggleGroup(radioGroup);
catRadio.setToggleGroup(radioGroup);
***If a BorderPane region does not contain anything,
- the region will appear gray by default
- an error will occur
- the content from an adjacent region will be duplicated in the empty region
- the region will not appear in the GUI
- the region will not appear in the GUI
How would a stylesheet named javafxstyles.css be applied to a JavaFX application, assuming that scene is the variable that refers to a Scene object?
- scene.getStylesheets().add(javafxstyles.css);
- scene.getStylesheets().add(“javafxstyles.css”);
- scene.addStylesheets().get(“javafxstyles.css”);
- scene.getStyles().add(“javafxstyles”);
- scene.getStylesheets().add(“javafxstyles.css”);
Given the following styles, what size will the text of myLabel be?
.root { -fx- font-size: 12pt; }
.label { -fx- font-size: 18pt; }
- 18 pts
- 15 pts
- 12 pts
- This will cause an error because there are duplicate font-size styles.
18pts
CSS uses the RGB color system to define colors and colors can be specified using six hexadecimal numbers preceded by the # symbol.
True
False
True
A TextArea is a multiline TextField that can accept or display several lines of text.
True
False
True
A ComboBox differs only from a ListView in that a ComboBox must have a minimum of three items.
True
False
False
Assuming three ImageView objects named puppy, kitten, and bunny have been created, what does the following statement do?
HBox hbox = new HBox(5, puppy, kitten, bunny);
- The statement does nothing; it contains an error.
- There will be five pixels of space between the controls horizontally in the container.
- The controls will be displayed vertically with five pixels between them.
- The number 5 referes to the number of ImageView objects so there will be two empty spots for more ImageView objects.
- There wil be five pixels of space between the controls horizontally in the container.
Adding RadioButton controls to a ________ object creates a mutually exclusive relationship between them.
- MutualGroup
- ToggleGroup
- ExcludeGroup
- RadioGroup
- ToggleGroup
***One important difference between the command line interface and a GUI interface is that
- in a GUI environment the user determines the order in which things happen while the user has no control over the order or events in a command line interface.
- users must type information in a command line interface but, when using a GUI, typing is never required.
- in command line the background color of hte monitor will always be black but in a GUI it can be any color.
- All of these are important differences.
- in a GUI environment the user determines the order in which things happen while the user has no control over the order or events in a command line interface.
Padding is space that appears around the inside edges of a container.
True
False
True
Radio buttons are normally used when you want the user to be able to select one or more options from a group of several possible options.
True
False
False
Select all that apply. Given the statement shown below, which of the following statements are true?
Scene scene = new Scene(hbox, 100, 500);
- A Scene object named scene will be created
- The height of the scene will be 100 pixels
- the root node is hbox
- The width of the scene will be 100 pixels
One1. A Scene object named scene will be created
Three3. The root node is hbox
Four4. The width of the scene will be 100 pixels
Select all that apply. The SetStyle method is used to apply style rules directly to a JavaFX node. This method
- is considered a better way to add styles than using a stylesheet
- allows you to pass only one style rule at a time, such as a string argument
- removes any styles that were previously applied to that node.
- allows you to pass multiple style rules as string arguments.
- removes any styles that were previously applied to that node.
- allows you to pass multiple style rules as string arguments.
Select all that apply. Which of the following are constructors of the BorderPane class?
- BorderPane(top, bottom)
- BorderPane(center, top, right, bottom, left)
- BorderPane(center)
- BorderPane()
- BorderPane(left, right)
- BorderPane(center, top, right, bottom, left)
- BorderPane(center)
- BorderPane()
Select all that apply. Which of the following are operations that can be performed by the launch method?
- creating a Stage object
- calling the start method
- calling the Application constructor
- calling an event handler
- creating a Stage object
- calling the start method
The ________ layout container arranges the contents into cells, similar to a spreadsheet.
- GRID
- CellPane
- GridPaneObj
- GridPane
- GridPane
The command line interface is an event-driven interface.
True
False
False
The process of connecting an event handler object to a control is called ________ the event handler.
- registering
- rendering
- passing
- applying
- registering
Select all that apply. Which of the following are possible selection nodes available to the ListView control?
- single selection node
- multiple selection mode
- single interval selection mode
- multiple interval selection node
One1. single selection node
Four4. multiple interval selection node
Select all that apply. Which of the following are regions where content can be displayed in the BorderPane layout container?
- above and below center
- top and bottom
- center
- left and right
- top and bottom
- center
- left and right
The ________ class is used to create a menu bar.
- MenuItem
- Menu
- MenuBar
- Bar
- MenuBar
An event object is created when an event takes place.
True
False
True