Question: 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),

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 setStyle("-fx-padding: 5, 0, 0, 5"). For each tile in table, embed a FlowPane container named panel with setPrefWidth(183) and setStyle("-fx-font-size: 10;"). Each panel should hold two components:

(1) A four-space Label named swatch that displays a color using a CSS color name, and

(2) An anonymous Label that displays a description for the color swatch at its left. Set the swatch colors with setStyle("-fx-background-color: " + names[i]), where names is an array shown in the following program skeleton.

public class ColorTable extends Application ( private final int TABLE WIDTH = 768; private final int

Figure 17.18:

* ticTacToe.css * Dean & Dean * Provides CSS rules for the TicTacToe program. .root ( } -fx-pref-width: 240;

public class ColorTable extends Application ( private final int TABLE WIDTH = 768; private final int TABLE_HEIGHT = 640; private String[] names = { https://docs.oracle.com/javafx/2/api/javafx/scene/ }; private String[] numbers = { }; } // end class ColorTable

Step by Step Solution

3.43 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create a program that generates the CSS color names window as described you will need to complete the JavaFX program skeleton provided in the first ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction To Programming With Java A Problem Solving Approach Questions!