Java Reference
In-Depth Information
You might have noticed that the screenshots in figures 2-4 and 2-5 have y values that are negative. this
is because the application was positioned on the secondary monitor, logically above the primary monitor, when the
screenshots were taken.
Note
13.
Click the application's Ui, drag it around the screen, and click close( ) when finished.
Congratulations on sticking with this 13-step exercise! performing this exercise has prepared
you to relate to the code behind it, which we now walk through together.
Understanding the StageCoach Program
Take a look at the code for the StageCoach program in Listing 2-1 before we point out new and relevant concepts.
Listing 2-1. StageCoachMain.java
package projavafx.stagecoach.ui;
import java.util.List;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.geometry.Rectangle2D;
import javafx.geometry.VPos;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Text;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.WindowEvent;
public class StageCoachMain extends Application {
StringProperty title = new SimpleStringProperty();
Text textStageX;
Text textStageY;
Text textStageW;
Text textStageH;
Text textStageF;
 
 
Search WWH ::




Custom Search