File tree Expand file tree Collapse file tree
src/de/voder/tutorial/javafx Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ *
3+ */
4+ package de .voder .tutorial .javafx ;
5+
6+ import javafx .application .Application ;
7+ import javafx .event .ActionEvent ;
8+ import javafx .event .EventHandler ;
9+ import javafx .scene .Scene ;
10+ import javafx .scene .control .Button ;
11+ import javafx .scene .layout .StackPane ;
12+ import javafx .stage .Stage ;
13+
14+ /**
15+ * @author volker
16+ *
17+ */
18+ public class HelloWorld extends Application {
19+
20+ /* (non-Javadoc)
21+ * @see javafx.application.Application#start(javafx.stage.Stage)
22+ */
23+ @ Override
24+ public void start (Stage primaryStage ) throws Exception {
25+ primaryStage .setTitle ("Voder's Hello World Example" );
26+ Button btn = new Button ();
27+ btn .setText ("Say 'Hello'!" );
28+ btn .setOnAction (new EventHandler <ActionEvent >(){
29+
30+ @ Override
31+ public void handle (ActionEvent arg0 ) {
32+ System .out .println ("Hello World!" );
33+ }
34+
35+ });
36+
37+ StackPane root = new StackPane ();
38+ root .getChildren ().add (btn );
39+ primaryStage .setScene (new Scene (root , 300 , 250 ));
40+ primaryStage .show ();
41+ }
42+
43+ /**
44+ * @param args
45+ */
46+ public static void main (String [] args ) {
47+ launch (args );
48+
49+ }
50+
51+ }
You can’t perform that action at this time.
0 commit comments