Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A FIowPane arranges the nodes in the pane horizontally from left to right or ver

ID: 3688789 • Letter: A

Question

A FIowPane arranges the nodes in the pane horizontally from left to right or vertically from top to bottom in the order in which they were added. A GridePane arranges nodes in a grid (matrix) formation. The nodes are placed m the specify column and row indices. A BorderPane can place nodes m five regions: top, bottom, left, right, and center. An HBox lays out its children in a single horizontal row. A VBox lays out its children a single vertical column. JavaFX provides many shape classes for drawing texts, lines, circles rectangle, ellipson, ses, arcs, polygons, and polylines. Write a program that displays four images in a grid shown in Figure 14.43a. Exercise 14.1 displays four images, (b) Exercise 14.2 displays a tic-tac-toe board with images. (c) Three cards are randomly selected. Write a program that displays a tic-tac-toe board, as shown in Figure 14.43b. A cell may be X, O, or empty. What to display at each cell is randomly decided. The X and O are images in the files x.gif and o.gif Write a program that displays three cards randomly selected from a deck of 52, as shown in Figure 14.43c. The card image files are named l.png, 2.png, ..., 52.png and stored in the image/card directors. All three cards are distinct and selected randomly. Write a program that displays five texts vertically, as shown in figure 14.44a random color and opacity for each text and set the font of each text to Times Roman, bold, italic, and 22 pixels.

Explanation / Answer

package Chapter_14; import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.FontPosture; import javafx.scene.text.FontWeight; import javafx.stage.Stage; /* * (Color and font) * Write a program that displays five texts vertically, * Set a random color and opacity for each text * and set the font of each text to Times Roman, bold, italic, and 22 pixels. */ public class Exercise_04 extends Application { @Override public void start(Stage primaryStage) { GridPane pane = new GridPane(); pane.setAlignment(Pos.CENTER); Label[] labels = new Label[5]; for (int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote