All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
introduction to programming with java a problem solving approach
Questions and Answers of
Introduction To Programming With Java A Problem Solving Approach
Where do the << h1>1> and </h1></h1> tags go in an HTML file?
What type of computer memory does C: usually refer to?
Use Oracle’s Java API documentation to help you describe each of the following StandardOpenOption constants: APPEND, CREATE, READ, TRUNCATE_EXISTING, and WRITE. public static BufferedWriter new
Modify the PrintInitials program so that it takes input from the keyboard but prints output to a file named output.txt. Use these suggestions: Add import java.io. PrintWriter; Append throws Exception
Change the Growth and GrowthDriver classes described in the Improved Accuracy and Efficiency. Using a Step-with-Midpoint Algorithm subsection. Run your modified program with these inputs:For your
HTML coding-style conventions require that all start tags have an accompanying end tag. Edit the book’s HTMLGenerator.java program so that end tags are inserted at the bottom of each paragraph. In
Piggyback off of the code StudentList class so that objects from that class can be written to a file. Provide an updated StudentList class heading so that the class supports serialization. Using this
Using this chapter’s ReadObject class as a guide, implement a StudentListFileReader class that reads and displays all objects in the file created in the previous exercise.Exercise 16.3:Piggyback
Java’s PrintWriter class is more versatile than the BufferedWriter class because it has more methods. Modify this chapter’s BufferedWriteToFile program so that instead of using BufferedWriter’s
Java’s Scanner class is more versatile than the BufferedReader class because it has more methods. Modify this chapter’s BufferedReadFromFile program so that instead of using BufferedReader’s
Modify this chapter’s WebPageReader program to read a web page through a buffer.Instead of importing InputStream, import BufferedReader and InputStreamReader.Instead of:use:And instead of:use:
Describe what the following program does and explain how it does it. import java.nio.DoubleBuffer; public class Temperatures { public static void main(String[] args) { double[] temps = new double[] {
Indicate the modifications you’d need to make to the code in the previous exercise if you want tempBuf2 to be a ByteBuffer instead of a Doublebuffer. Assume that tempBuf continues to be a
Implement a program that creates a file named Lincoln.txt that contains the string “Government of the people, by the people, for the people, shall not perish from the earth.” To create the file,
Implement a program that uses a FileChannel to read from a text file. Feel free to create the text file with an editor such as Microsoft NotePad or use the Lincoln.txt file from the previous
Create a text file (with an editor such as Microsoft NotePad) named TwoYearsBeforeTheMast.txt which contains this text:Six days shalt thou labor and do all thou art able, and on the
Modify this chapter’s DirectoryDescription program to print name and size information for only those files whose “glob” pattern matches a user-specified string. To do this, you’ll need to
Modify this chapter’s FindFiles program to restrict its search to just one directory. Do this by conditionally returning SKIP_SUBTREE at an appropriate place in the FileVisitor class.
Why are Swing components considered to be lightweight (as opposed to AWT components, which are considered to be heavyweight)?
What is an RIA?
Provide several reasons why JavaFX is considered to be an improvement over Swing and AWT?
What class should be used as a superclass for your JavaFX programs?
How is the start method special?
What are two ways to cause a window to be a certain size?
To position a program’s window on the computer screen, you can call the Stage object’s setX and setY methods with x and y argument values that specify the x, y coordinate position of the
In a single statement, declare a Label reference variable named hello and initialize it with the string “Hello World!”.
If you’d like to limit a Label control to a width narrower than its surrounding container, what two methods should you call?
Provide a statement that reduces a text box’s current preferred column count by two. Assume the text box’s name is nameBox. As you might expect, there is also a getPrefColumnCount method.
How is the TextField class’s setPromptText method different from its setText method?
If you have only one component, you can add it directly to a Scene object, but not with multiple components. How can you add multiple components to a scene?
What is an event?
Provide a statement that uses setOnAction to register an event handler named verify with a Button control named verifyButton.
If you want to reuse the code for an event handler, which is better—a method reference or a lambda expression?
The bind method is used for property binding. What type of interface does the bind method’s parameter implement?
Provide a statement in which a label named heading calls setStyle to position itself top-center in its container and set the size of its font to 16.
What is the JavaFX CSS property that causes a horizontal line to be drawn through it, like this?
What is wrong with the following 45 degrees value for an -fx-rotate JavaFX CSS property?-fx-rotate: 45 deg;
If you specify style properties for a container, all of that container’s properties automatically apply to all of that container’s components. (T / F)
For a JavaFX CSS property that does not exhibit inheritance by default, what can you do to make it exhibit inheritance?
What does the .root selector do?
Provide a statement that links a style sheet named petShop.css to a JavaFX window that has a Scene object named scene.
It is legal to add more than one style sheet file to a scene graph root container. (T / F)
With the higher priority places at the top, what is the cascade of places where JavaFX CSS property values can be assigned to a scene graph node?
In the FactorialButton program, what statement prevents a user from entering anything directly into the factorial text box?
What JavaFX CSS property determines the horizontal gap between components in a container?
Within an event handler, what is returned when there is an e.getSource() method call?
What Button method can you use to retrieve a button’s label?
Provide three style sheet rules with selectors named message1, message2, and message3 that use red, green, and blue to display an opaque dark magenta background color. For the three rules, use
Provide a style sheet rule with a selector named label that uses an hsba construct to display a 50% transparent light blue background color.
In the first Java compiler, all GUI classes were bundled into one area of the Java API library and its name was the _____________.
For each of the following, what Java API package must you import?a) Applicationb) Stagec) Scened) Label
Write a minimal JavaFX program that displays a Label containing “Good Morning” text. No need for comments and no need for a launch method. The display should look something like this: Good
What can you do to prevent users from updating a TextField control named textBox?
Give three examples of how a user might cause an event to be fired.
A HelloGoodbye program generates two windows, like this:After the user closes the smaller window by clicking its X, the outer window displays “Goodbye, World!”, like this:The setOnHiding method
Complete the program that displays this “Hello World” message:Note these styling characteristics:(1) Pane: top-center alignment with 10- point padding;(2) Label’s font: italic, 30 point,
What are two advantages of using a style sheet as opposed to inline styles?
Given this start method:Using the above method, implement a program and a style sheet that, together, produce the following window. The width and height are 300 and 200 pixels, respectively, the
By calling setDisable(true), you can disable a button and give it a muted (grayed out) appearance and make its handler unresponsive to clicks on it. Modify the FactorialButton program so that the
What color name is best for displaying something with a color reminiscent of a grass backyard?
Provide three class selector rules for a style sheet, such that each rule displays an opaque dark yellow background color, but using a different technique. All three rules use an RGB value, but the
Provide a class selector rule for a style sheet that uses an hsba construct to display a 50% transparent light green background color. Use the name header for the selector.
JavaFX layout panes are designed to adjust their components’ positions if the user resizes the layout pane’s window or if the code resizes the layout pane’s components. (T / F)
Which package holds the layout pane classes?
How does the FlowPane arrange its components?
Assume you’ve instantiated a FlowPane or GridPane container and assigned it to a variable named pane. Provide a single statement that causes pane to use center-right alignment for its components.
For the GridPane version of the Greeting program, write a statement that makes the greeting start under the name box, and allocate just enough cells to avoid resizing the text box if the name is long.
Provide a single statement that declares a stage named stage2 and initializes it to a new utility stage.
What are the five areas in a BorderPane layout in the order used by the five- parameter constructor, and which areas get the corners?
The sizes of the five areas in a BorderPane are determined at runtime based on the contents of the four outer areas. (T / F)
By default, how many components can you put in any one area of a BorderPane?
Given the reference, BorderPane pane = new BorderPane(); write a single statement that adds a new Label with the text “Stop” to the center area of a BorderPane. The label should be centered
When you instantiate a TilePane, you should always specify both the number of rows and the number of columns. (T / F)
In a TilePane, all cells are the same size. (T / F)
What happens to the xTurn variable in the TicTacToe program if you click the same cell twice?
Why are embedded panes particularly useful in BorderPane, TilePane, and GridPane outer containers (as opposed to FlowPane, VBox, and HBox outer containers)?
If you add a Circle to a plain Pane without specifying the Circle’s position, where does the Circle go and how much of it is visible?
In a FlowPane, a button control expands so that it completely fills the size of the area in which it is placed. (T / F)
Assume you have assigned a GridPane container object to a pane reference variable. Write a code fragment that fixes the width of the container’s second column at 200 pixels but lets the GridPane
Rewrite the Recital program so that instead of using a secondary stage to obtain string values for the data array, it uses System.out.println to display each prompt in the console window and uses
Provide a complete program that is a modification of the lambda-expression version Greeting program. Your new program should use a BorderPane (instead of a FlowPane), and it should generate the
In a BorderPane, what happens if the right area is empty? Said another way, which area(s), if any, expand(s) if the right area is empty?
In the AfricanCountries program in Figure 18.10, suppose there is no setMaxSize method call. What would the resulting window look like?Figure 18.10:
Assume you have this program:a) Modify the above code to produce this output:b) Modify the above code to produce this output:For both(a) and (b), call setAlignment(component, Pos.CENTER). import
If a Button component is directly added to a TilePane cell, it expands so that it completely fills the size of its cell. (T / F)
Assume a TilePane is constructed with no specification of orientation. Given the following code fragment, draw a picture that illustrates the buttons’ positions within the program’s window.
Modify the AfricanCountries program in Figure 18.10 in Section 18.5 to produce an initial display that looks like this:Create the scene with a width of 400 and a height of 200. Embed a StackPane in
Write a program that generates the CSS color names window shown in Figure 17.18. In your program, implement a TilePane container named table with setPrefColumns(4), setHgap(5), setVgap(2), and
Write a program that uses setTranslateX and setTranslateY to position a bright blue circle of radius 50 in the center of a plain Pane that’s in a Scene of width 200 and height 150.
Provide three user interface design guidelines for GUI programs.
TextArea components are editable by default. (T / F)
TextArea components employ line wrap by default. (T / F)
What happens if you click a check box that’s already selected?
Write a code fragment that creates a check box named attendance with an “I will attend” label and then puts it into its selected state.
What happens if you click a radio button that is already selected?
What happens if you click an initially unselected radio button that is a member of a ToggleGroup?
How are combo boxes and radio button groups similar?
What method call retrieves the current selection in a combo box?
In the JobApplication program, what happens if the following code is omitted?ToggleGroup radioGroup = new ToggleGroup();...good.setToggleGroup(radioGroup);bad.setToggleGroup(radioGroup);
How are MenuBar, Menu, and MenuItem objects related?
Showing 1 - 100
of 717
1
2
3
4
5
6
7
8