fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. primaryStage.setTitle("Hello World!");
  13. Button btn = new Button();
  14. btn.setText("Say 'Hello World'");
  15. btn.setOnAction(new EventHandler<ActionEvent>() {
  16.  
  17. @Override
  18. public void handle(ActionEvent event) {
  19. System.out.println("Hello World!");
  20. }
  21. });
  22.  
  23. StackPane root = new StackPane();
  24. root.getChildren().add(btn);
  25. primaryStage.setScene(new Scene(root, 300, 250));
  26. primaryStage.show();
  27.  
  28. // your code goes here
  29. }
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: error: cannot find symbol
	 primaryStage.setTitle("Hello World!");
	 ^
  symbol:   variable primaryStage
  location: class Ideone
Main.java:13: error: cannot find symbol
        Button btn = new Button();
        ^
  symbol:   class Button
  location: class Ideone
Main.java:13: error: cannot find symbol
        Button btn = new Button();
                         ^
  symbol:   class Button
  location: class Ideone
Main.java:15: error: cannot find symbol
        btn.setOnAction(new EventHandler<ActionEvent>() {
                            ^
  symbol:   class EventHandler
  location: class Ideone
Main.java:15: error: cannot find symbol
        btn.setOnAction(new EventHandler<ActionEvent>() {
                                         ^
  symbol:   class ActionEvent
  location: class Ideone
Main.java:23: error: cannot find symbol
        StackPane root = new StackPane();
        ^
  symbol:   class StackPane
  location: class Ideone
Main.java:23: error: cannot find symbol
        StackPane root = new StackPane();
                             ^
  symbol:   class StackPane
  location: class Ideone
Main.java:25: error: cannot find symbol
        primaryStage.setScene(new Scene(root, 300, 250));
                                  ^
  symbol:   class Scene
  location: class Ideone
Main.java:25: error: cannot find symbol
        primaryStage.setScene(new Scene(root, 300, 250));
        ^
  symbol:   variable primaryStage
  location: class Ideone
Main.java:26: error: cannot find symbol
        primaryStage.show();
        ^
  symbol:   variable primaryStage
  location: class Ideone
10 errors
stdout
Standard output is empty