If you want to change the image that an ImageView object is displaying, what method do you call?
> How do you get a Slider’s current value?
> Which CSS style property specifies the font for a control’s text?
> What type of event does a Slider generate when its slider knob is moved?
> What Slider methods do you use to perform each of these operations? 1. Establish the spacing of major tick marks. 2. Establish the spacing of minor tick marks. 3. Cause tick marks to be displayed. 4. Cause labels to be displayed.
> The variable names references an integer array with 20 elements. Write a for loop that prints each element of the array.
> What is the difference between an editable ComboBox and an uneditable ComboBox?
> What type of event do ComboBox controls generate when they are clicked?
> How do you retrieve the selected item from a ComboBox?
> In what type of object does the ComboBox control keep its list of items?
> How do you set the orientation of a ListView control?
> What is multiple interval selection mode?
> What is single selection mode?
> How do you retrieve the selected item from a ListView control?
> You haven’t yet learned about the MenuButton control, but you have learned how to convert JavaFX class names to CSS type selectors. What would the type selector name for the MenuButton class be?
> How do you set the size of a ListView?
> Consider the following class declaration: public class Square { private double sideLength; public double getArea () { return sideLength * sideLength; } public double getSideLength () { return sideLength; } } 1. Write a no-arg constructor for this class.
> What type of event do CheckBox controls generate when they are clicked?
> In code, how do you make a CheckBox appear selected?
> How do you determine in code whether a CheckBox is selected?
> What type of event do RadioButton controls generate when they are clicked?
> In code, how do you make a RadioButton appear selected?
> How do you determine in code whether a RadioButton is selected?
> How do you create a mutually exclusive relationship between RadioButton controls?
> In a style definition, what type of selector begins with a # character?
> In the hexadecimal color value #0511FF, the FF value specifies which color component?
> What is the type selector name that corresponds to each of the following JavaFX types? Button TextField Label ImageView
> Design a class named Pet, which should have the following fields: - name. The name field holds the name of a pet. - animal. The animal field holds the type of animal that a pet is. Example values are “Dogâ€, “Catâ€, and “Birdâ€. - age. The age fiel
> What type of scene graph node can have children? What type cannot?
> What are the three types of nodes in a scene graph?
> What is a scene graph?
> Is a window the same as a stage, or a scene?
> What is JavaFX?
> What is an event-driven program?
> Describe the three BorderPane constructors.
> What are the names of the regions in a BorderPane container?
> Describe three different techniques discussed in this chapter for writing event handlers.
> How do you retrieve the text that the user has entered into a TextField control?
> Write a method named getName that prompts the user to enter his or her first name, and then returns the user’s input.
> In what package is the TextField class?
> What method do you call to register an event handler with a Button control?
> In what package is the EventHandler interface?
> What is an event handler?
> When the user runs a program in a text-based environment, such as the command line interface, what determines the order in which things happen?
> What is an event? Give an example.
> Once you have created a GridPane container, how do you add a control to a Âspecific column and row?
> How do you set the horizontal and vertical spacing in a GridPane container?
> What package is the Insets class in?
> What is the difference between spacing and padding, in regard to layout containers?
> Write a method named timesTen. The method should accept a double argument, and return a double value that is ten times the value of the argument.
> If you want to make sure that an image does not appear stretched after it is resized, what method do you call?
> How do you set the width and height of an ImageView?
> If you want to display an image in a layout container, do you add an Image object, or an ImageView object to the layout container?
> What package contains the Image and ImageView classes?
> How does a command line interface work?
> What package is the Pos enumeration in?
> How do you change the alignment of an HBox container?
> The Scene class is in what package?
> If you want to arrange controls in a grid, with rows and columns, what layout container would you use?
> A program contains the following method definition: public static int cube(int num) { return num * num * num; } Write a statement that passes the value 4 to this method and assigns its return value to a variable named result.
> Account Balance A program that calculates the current balance in a savings account must ask the user for the following: The Starting Balance The total dollar amount of deposits made The total dollar amount of withdrawals made The monthly interest rate On
> What is the general difference between an HBox layout container, and a VBox layout container?
> The program in Code Listing12-1 calls a Stage class’s show method. What does this method do?
> The program in Code Listing12-1 calls a Stage class’s setTitle method. What does this method do?
> What is the purpose of the Application class’s abstract start method?
> What is the purpose of the launch method of the Application class?
> The JavaFX library has an abstract class that is the foundation of a GUI application. What is the name of the class?
> What is a user interface?
> If multiple exceptions can be thrown by code in a try block, how does the JVM know which catch clause it should pass the control of the program to?
> What is the difference between a try block and a catch block?
> How do you retrieve an error message from an exception?
> After the catch block has handled the exception, where does program execution resume?
> Look at the following method header: public static void myMethod(int a, int b, int c) Now look at the following call to myMethod: myMethod(3, 2, 1); When this call executes, what value will be stored in a? What value will be stored in b? What value will
> What is the difference between exceptions that inherit from the Error class and exceptions that inherit from the Exception class?
> Other than the Object class, what is the superclass for all exceptions?
> If an exception is thrown and the program does not handle it, what happens?
> What must you do to a class in order to serialize objects of that class?
> What are the two modes that a random access file may be opened in? Explain the difference between them.
> What class do you use to work with random access files?
> What is the difference between sequential and random access?
> What classes do you use to write output to a binary file? What classes do you use to read from a binary file?
> What is the difference between a text file and a binary file?
> Examine the following method header, and then write an example call to the method: public static void doSomething(int x)
> What does it mean to “throw" an exception?
> If you are writing a custom exception class, how can you make sure it is checked? How can you make sure it is unchecked?
> If a method has a throw statement, does it always have to have a throws clause in its header? Why or why not?
> What is the difference between the throw statement and the throws clause?
> What is the purpose of the argument that is passed to an exception object’s constructor? What happens if you do not pass an argument to the constructor?
> What does the throw statement do?
> When are you required to have a throws clause in a method header?
> What are the differences between a checked and an unchecked exception?
> A program’s main method calls method A, which calls method B. None of these methods performs any exception handling. The code in method B throws an Âexception. Describe what happens.
> What is the call stack? What is a stack trace?
> Convert the following while loop to a for loop: int count = 0; while (count < 50) { System.out.println("count is " + count) ; Count++ ; }
> When does the code in a finally block execute?
> Briefly describe what an exception is.
> If a method in a subclass has the same name as a method in the superclass, but uses a different parameter list, does the subclass method overload or override the Âsuperclass method?
> If a method in a subclass has the same signature as a method in the superclass, does the subclass method overload or override the superclass method?
> How can a subclass method call an overridden superclass method?
> Under what circumstances would a subclass need to override a superclass method?
> Look at the following classes: public class Ground { public Ground() { System.out.println("You are on the ground."); } public Ground(String groundColor) { System.out.println("The ground is " + groundColor); } } public class Sky extends Ground { public S