-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a5d2da
commit 94a5268
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//************************************************************************ | ||
// HelloJavaFX.java Author: Lewis/Loftus | ||
// | ||
// Demonstrates a basic JavaFX application. | ||
//************************************************************************ | ||
|
||
import javafx.application.Application; | ||
import javafx.scene.Group; | ||
import javafx.scene.Scene; | ||
import javafx.scene.paint.Color; | ||
import javafx.scene.text.Text; | ||
import javafx.stage.Stage; | ||
|
||
public class HelloJavaFX extends Application | ||
{ | ||
//-------------------------------------------------------------------- | ||
// Creates and displays two Text objects in a JavaFX window. | ||
//-------------------------------------------------------------------- | ||
public void start(Stage primaryStage) | ||
{ | ||
Text hello = new Text(50, 50, "Hello, JavaFX!"); | ||
Text question = new Text(120, 80, "How's it going?"); | ||
|
||
Group root = new Group(hello, question); | ||
Scene scene = new Scene(root, 300, 120, Color.LIGHTGREEN); | ||
|
||
primaryStage.setTitle("A JavaFX Program"); | ||
primaryStage.setScene(scene); | ||
primaryStage.show(); | ||
} | ||
|
||
//-------------------------------------------------------------------- | ||
// Launches the JavaFX application. This method is not required | ||
// in IDEs that launch JavaFX applications automatically. | ||
//-------------------------------------------------------------------- | ||
public static void main(String[] args) | ||
{ | ||
launch(args); | ||
} | ||
} |