< prev index next >

modules/graphics/src/main/java/javafx/application/Application.java

Print this page




 122 import javafx.application.Application;
 123 import javafx.scene.Group;
 124 import javafx.scene.Scene;
 125 import javafx.scene.shape.Circle;
 126 import javafx.stage.Stage;
 127 
 128 public class MyApp extends Application {
 129     public void start(Stage stage) {
 130         Circle circ = new Circle(40, 40, 30);
 131         Group root = new Group(circ);
 132         Scene scene = new Scene(root, 400, 300);
 133 
 134         stage.setTitle("My JavaFX Application");
 135         stage.setScene(scene);
 136         stage.show();
 137     }
 138 }
 139  * </code></pre>
 140  *
 141  * <p>The above example will produce the following:</p>
 142  * <p><img src="doc-files/Application.png"/></p>
 143  * @since JavaFX 2.0
 144  */
 145 public abstract class Application {
 146     /**
 147      * Constant for user agent stylesheet for the "Caspian" theme. Caspian
 148      * is the theme that shipped as default in JavaFX 2.x.
 149      * @since JavaFX 8.0
 150      */
 151     public static final String STYLESHEET_CASPIAN = "CASPIAN";
 152     /**
 153      * Constant for user agent stylesheet for the "Modena" theme. Modena
 154      * is the default theme for JavaFX 8.x.
 155      * @since JavaFX 8.0
 156      */
 157     public static final String STYLESHEET_MODENA = "MODENA";
 158 
 159     /**
 160      * Launch a standalone application. This method is typically called
 161      * from the main method(). It must not be called more than once or an
 162      * exception will be thrown.




 122 import javafx.application.Application;
 123 import javafx.scene.Group;
 124 import javafx.scene.Scene;
 125 import javafx.scene.shape.Circle;
 126 import javafx.stage.Stage;
 127 
 128 public class MyApp extends Application {
 129     public void start(Stage stage) {
 130         Circle circ = new Circle(40, 40, 30);
 131         Group root = new Group(circ);
 132         Scene scene = new Scene(root, 400, 300);
 133 
 134         stage.setTitle("My JavaFX Application");
 135         stage.setScene(scene);
 136         stage.show();
 137     }
 138 }
 139  * </code></pre>
 140  *
 141  * <p>The above example will produce the following:</p>
 142  * <p><img src="doc-files/Application.png" alt=""></p>
 143  * @since JavaFX 2.0
 144  */
 145 public abstract class Application {
 146     /**
 147      * Constant for user agent stylesheet for the "Caspian" theme. Caspian
 148      * is the theme that shipped as default in JavaFX 2.x.
 149      * @since JavaFX 8.0
 150      */
 151     public static final String STYLESHEET_CASPIAN = "CASPIAN";
 152     /**
 153      * Constant for user agent stylesheet for the "Modena" theme. Modena
 154      * is the default theme for JavaFX 8.x.
 155      * @since JavaFX 8.0
 156      */
 157     public static final String STYLESHEET_MODENA = "MODENA";
 158 
 159     /**
 160      * Launch a standalone application. This method is typically called
 161      * from the main method(). It must not be called more than once or an
 162      * exception will be thrown.


< prev index next >