What is the difference between a frame and a panel?
> 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?
> Write a method that accepts a StringBuilder object as an argument and converts all occurrences of the lowercase letter ‘t’ in the object to uppercase.
> Assume that the following declarations exist: final String DB_URL = "jdbc:derby:CoffeeDB” ; String sql = "SELECT * FROM Coffee"; Write code that uses these String objects to get a database connection and execute the SQL statement. Be sure to close the co
> How can you sort the results of a SELECT statement on a specific column?
> What is the purpose of the % symbol in a character pattern used by the LIKE Âoperator? What is the purpose of the underline ( _ ) character?
> What is the purpose of the LIKE operator?
> Assume that a database has a table named Inventory, with the following columns? 1. Write a SELECT statement that will return all of the columns from every row in table. 2. Write a SELECT statement that will return the ProductID column from every row in t
> Look at the following SQL statement. SELECT Id FROM Account What is the name of the table from which this statement is retrieving data? What is the name of the column that is being retrieved?
> What is a ResultSet object?
> What Java data types correspond with the following SQL types? - INTEGER - INT - REAL - CHARACTER - VARCHAR - DOUBLE
> Why do most businesses use a DBMS to store their data instead of creating their own text files or binary files to hold the data?
> How do you change the background color of a component? How do you change the color of text displayed by a label or a button?
> Write a method that accepts a reference to a String object as an argument and returns true if the argument ends with the substring “.comâ€. Otherwise, the method should return false.
> How do you register an event listener with a JButton component?
> If you are writing an event listener class for a JButton component, what interface must the class implement? What method must the class have? When is this method executed?
> What is an event listener?
> What is a content pane?
> How do you display a frame on the screen?
> What is the preferred way of creating a Border object?
> What method do you use to set a border around a component?
> How do you determine in code whether a check box is selected?
> How do you determine in code whether a radio button is selected?
> Write a loop that counts the number of digits that appear in the String object str.
> What type of event does a check box generate when the user clicks on it?
> What type of event does a radio button generate when the user clicks on it?
> Do you normally add radio buttons, check boxes, or both to a ButtonGroup object?
> What is the purpose of a ButtonGroup object?
> How do you set a frame’s size?
> You want the user to be able to select any number of items from a group of items. Which type of component would you use for the items, radio buttons or check boxes?
> You want the user to be able to select only one item from a group of items. Which type of component would you use for the items, radio buttons or check boxes?
> What is the default layout manager for a JFrame object’s content pane? For a JPanel object?
> How can you cause a content pane to be automatically sized to accommodate the components contained within it?
> How do you prevent the BorderLayout manager from resizing a component that has been placed in its region?
> The following if statement determines whether choice is equal to ‘Y’ or ‘y’: if (choice == 'Y' || choice == 'y') Rewrite this statement so it makes only one comparison and does not use the || operator. (Hint: Use either the toUpperCase or toLower
> How many components can you have at one time in a BorderLayout region? In a GridLayout cell?
> Which layout manager arranges components in rows and columns?
> Which layout manager arranges components in a row, from left to right, in the order they were added to the container?
> Which layout manager divides a container into regions known as north, south, east, west, and center?
> How do you add a layout manager to a container?
> What is a frame? How do you create a frame with Swing?
> What is direct recursion? What is indirect recursion?
> What causes a recursive algorithm to stop calling itself?
> What is a recursive case?
> What is a base case?
> A pet store sells dogs, cats, birds, and hamsters. Write a declaration for an enumerated data type that can represent the types of pets the store sells.
> It is said that a recursive algorithm has more overhead than an iterative algorithm. What does this mean?
> What shape method do you call to rotate a shape around its center?
> What shape method do you call to change a shape’s fill color?
> What shape method do you call to change the color of a shape’s outline?
> In what package is the Pane class?
> In what package is the Color class?
> Refer to your answer for Checkpoint14.41 . What does the method return? Data from Checkpoint 14.41: What KeyEvent method can you call to determine which key the user pressed?
> What KeyEvent method can you call to determine which key the user pressed?
> What type of event happens when the user presses and releases a key that produces a Unicode character?
> In what package is the Shape class?
> Consider the following class declaration: public class Circle { private double radius; public Circle(double r) { radius = r; } public double getArea () { return Math.PI * radius * radius; } public double getRadius() { return radius; } } 1. Write a toStri
> What type of event happens when the user releases a key on the keyboard?
> What type of event happens when the user presses a key on the keyboard?
> How do you set the size of a video’s viewing window?
> In what package are the three classes?
> What three classes do you use to play a video file?
> What does the MediaPlayer method setCycleCount do?
> What does the MediaPlayer method setAutoPlay do?
> Refer to your answer to Checkpoint14.31 . In what package are the two classes? Data from Checkpoint 14.31: What two classes do you use to play an audio file?
> What two classes do you use to play an audio file?
> If you want to combine multiple effects on a single node, which Node class method would you use to set the effect?
> The values variable references a two-dimensional double array with 10 rows and 20 columns. Write code that sums all the elements in the array and stores the sum in the variable total.