What method do you use to store an image in an existing JLabel or JButton component?
> What is an fx:id?
> Write a method that searches a numeric array for a specified value. The method should return the subscript of the element containing the value if it is found in the array. If the value is not found, the method should throw an exception of the Exception c
> Which Scene Builder panel allows you to work with a component’s properties, Âlayout, and code?
> Which Scene Builder panel shows the scene graph?
> Which Scene Builder panel do you use to visually design an application’s GUI?
> Which Scene Builder panel provides a list of JavaFX components?
> What is a GUI?
> What statement would you write in an HTML document to display the text “Hello World†in bold and italic?
> What statement would you write in an HTML document to display the text “My Resume†in bold and centered on the page?
> What statement would you write in an HTML document to display the text “Student Roster†as a level one header?
> What tag marks the beginning and end of an HTML document’s body section?
> What statement would you use in an HTML document to display the text “My Web Page†in the browser’s title bar? What section of the HTML document would this statement be written in?
> Assume that the reference variable r refers to a serializable object. Write code that serializes the object to the file ObjectData.dat.
> What tag marks the beginning and end of an HTML document’s head section?
> What is the difference between the Applet class’s getDocumentBase and getCodeBase methods?
> What methods does an AudioClip object have? What do they do?
> What is the difference between using the Applet method asked for in Checkpoint19.35 , and using an AudioClip object to play a sound file?
> What Applet method can you use to play a sound file?
> How to you cause a Timer object to cease generating action events?
> How do you cause a Timer object to begin generating action events?
> How are the time intervals between a Timer object’s action events measured?
> What type of events do Timer objects generate?
> What is an adapter class, and how does it make some programming tasks easier?
> Look at the following program and tell what it will output when run: public class ExceptionTest { public static void main(String[] args) { int number; String str; try { str = "xyz"; number = Integer.parseInt(str); System.out.println("A"); } catch(NumberF
> What tag marks the beginning and end of an HTML document?
> If a class implements the MouseListener interface but does not need to use all of the methods specified by the interface, can the definitions for those methods be left out? If not, how are these methods dealt with?
> What type of object do mouse listener and mouse motion listener methods accept? What methods do these types of objects provide for determining a mouse cursor’s location?
> What interface would a listener class implement to handle a mouse click event? A mouse press event? A mouse dragged event? A mouse release event? A mouse move event?
> What is the difference between a mouse press event and a mouse click event?
> What Graphics class methods do you use to perform the following tasks? 1. Draw a line. 2. Draw a filled rectangle. 3. Draw a filled oval. 4. Draw a filled arc. 5. Set the drawing color. 6. Draw a rectangle. 7. Draw an oval. 8. Draw an arc. 9. Draw a stri
> What values are contained in the two arrays that are passed to a Graphics object’s drawPolygon method?
> When using a Graphics object to draw an oval, what invisible shape is the oval enclosed in?
> How do you force the paint or paintComponent method to be called?
> In the paint or paintComponent method, what should be done before anything else?
> Look at the following interface: public interface Computable { double compute(double x); } Write a statement that uses a lambda expression to create an object that implements the Computable interface. The object’s name should be half. The half objectâ€
> When are the paint and paintComponent method called?
> Why do applets run in a restricted environment?
> In a JPanel object, do you override the paint or paintComponent method to get a reference to the Graphics object?
> In an AWT component, or a class that extends JApplet or JFrame, if you want to get a reference to the Graphics object, do you override the paint or paintComponent method?
> In Swing, if an object’s class extends JFrame or JApplet, you add components to its content pane. How do you add components to an object if its class extends Frame or Applet?
> To create an applet using AWT, what class do you inherit your applet class from?
> Suppose the file MyApplet.java contains the Java source code for an applet. What tag would you write in an HTML document to run the applet in an area that is 400 pixels wide by 200 pixels high?
> Why is there no need for a static main method to create an instance of an applet class?
> Instead of a constructor, an applet class uses what method?
> Instead of JFrame, an applet class is extended from what class?
> Write the first line of the definition for a Stereo class. The class should extend the SoundSystem class, and it should implement the CDplayable, TunerPlayable, and CassettePlayable interfaces.
> Suppose you wanted to display the text “Click Here†as a link to the Web site http://java.sun.com. What statement would you write to create the text?
> What tag causes a line break? What tag causes a paragraph break? What tag Âdisplays a horizontal rule?
> How is an applet that is associated with a Web page executed on a user’s system?
> How do you store an image in a JButton component? How do you store both an image and text in a JButton component?
> How do you store an image in a JLabel component? How do you store both an image and text in a JLabel component?
> What is the difference between an uneditable and an editable combo box? Which of these is a combo box by default?
> How do you retrieve the selected item from a JComboBox component? How do you get the index of the selected item?
> How do you cause a scroll bar to be displayed with a JList component?
> What JSlider 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.
> A superclass has the following method: public void setValue(int v) { value = v; } Write a statement that may appear in a subclass that calls this method, passing 10 as an argument.
> How would each of the following numbers be represented in E notation? 1. 3.287 ×106 2. −9.7865 × 1012 3. 7.65491 × 10−3
> How do you retrieve the selected item from a JList component? How do you get the index of the selected item?
> What type of event does a JSlider generate when its slider knob is moved?
> What are the arguments that you pass to the Font class constructor?
> What type of argument does a component’s setFont method accept?
> What is line wrapping? What are the two styles of line wrapping? How do you turn a JTextArea component’s line wrapping on? How do you select a line wrapping style?
> Does the JTextArea component automatically display scroll bars? If not, how do you accomplish this?
> How do you retrieve the text that is stored in a JTextArea component?
> What arguments do you pass to the JTextArea constructor?
> What arguments do you pass to the Dimension class constructor?
> How do you change the size of a component such as a JLabel after it has been Âcreated?
> Write the declaration for class B. The class’s members should be as follows: - m, an integer. This variable should not be accessible to code outside the class or to any class that extends class B. - n, an integer. This variable should be accessible onl
> What type of event do menu items generate when selected by the user?
> What is the index of the first item stored in a JList or a JComboBox component? If one of these components holds 12 items, what is the index of the 12th item?
> How do you place a menu bar in a JFrame?
> What class do you use to create a menu bar?
> What class do you use to create a menu? What do you pass to the class Âconstructor?
> What class do you use to create a check box menu item? What do you pass to the class constructor? How do you cause it to be initially selected?
> How do you create a relationship between radio button menu items so that only one may be selected at a time?
> What class do you use to create a radio button menu item? What do you pass to the class constructor? How do you cause it to be initially selected?
> What class do you use to create a regular menu item? What do you pass to the class constructor?
> Briefly describe each of the following menu system items: 1. Menu bar 2. Menu item 3. Check box menu item 4. Radio button menu item 5. submenu 6. Separator bar
> Write the first line of the definition for a Poodle class. The class should extend the Dog class.
> What is a tool tip? How do you assign a tool tip to a component?
> What is a mnemonic? How do you assign a mnemonic to a component?
> How do you make a text field read-only? In code, how do you store text in a text field?
> What is a primary key?
> Describe how the data that is stored in a table is organized.
> What static JDBC method do you call to get a connection to a database?
> Suppose you have either Java DB or Apache Derby database on your system named InventoryDB. What database URL would you use in a Java program to get a connection to the database?
> What is a database URL?
> What is the standard language for working with database management systems?
> What is the technology that makes it possible for a Java application to Âcommunicate with a DBMS?
> Assume that d is a double variable. Write an if statement that assigns d to the int variable i if the value in d is not larger than the maximum value for an int.
> Write a statement to delete the Book table you created in Checkpoint16.25. Data from Checkpoint 16.25: Write the SQL statement to create a table named Book. The Book table should have the columns to hold the name of the publisher, the name of the author
> Write the SQL statement to create a table named Book. The Book table should have the columns to hold the name of the publisher, the name of the author, the number of pages, and a 10-character ISBN number.
> The sale on decaf coffee didn’t do too well, so the Midnight Coffee Roastery has decided to stop selling decaf. Write an SQL statement that will delete all decaf Âcoffees from the Coffee table.
> The Midnight Coffee Roastery is running a special on decaf coffee. Write an SQL statement that changes the price of all decaf coffees to 4.95.
> Rewrite the following INSERT statement so that it specifies the Coffee table’s column names. INSERT INTO Coffee VALUES ('Honduran Dark', '22-001', 8.65)
> Write an SQL statement to insert a new row into the Coffee table containing the following data: Description: Eastern Blend ProdNum: 30-001 Price: 18.95
> Assume that a valid ResultSet object exists, populated with data. What method do you call to retrieve column 3 as a string? What do you pass as an argument to the method?
> When a Java programmer uses a DBMS to store and manipulate data, why doesn’t the programmer need to know specific details about the physical structure of the data?
> Where does a ResultSet object’s cursor initially point? How do you move the cursor forward in the result set?
> How do you submit a SELECT statement to the DBM?