40 lines
1019 B
Java
40 lines
1019 B
Java
package mobireader;
|
|
|
|
import javafx.application.Application;
|
|
import javafx.event.ActionEvent;
|
|
import javafx.event.EventHandler;
|
|
import javafx.scene.Scene;
|
|
import javafx.scene.control.Button;
|
|
import javafx.scene.layout.StackPane;
|
|
import javafx.stage.Stage;
|
|
|
|
|
|
public class MobiReader extends Application {
|
|
|
|
@Override
|
|
public void start(Stage primaryStage) {
|
|
Button btn = new Button();
|
|
btn.setText("Display help");
|
|
btn.setOnAction(new EventHandler<ActionEvent>() {
|
|
@Override
|
|
public void handle(ActionEvent event) {
|
|
System.out.println("Read the docs! Trololo.");
|
|
}
|
|
});
|
|
|
|
StackPane root = new StackPane();
|
|
root.getChildren().add(btn);
|
|
|
|
Scene scene = new Scene(root, 300, 250);
|
|
|
|
primaryStage.setTitle("Hello World!");
|
|
primaryStage.setScene(scene);
|
|
primaryStage.show();
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
launch(args);
|
|
|
|
}
|
|
}
|