UPDATE java 8 jdk works with title bar. It's only an issue with java 11 jdk
I'm learning javafx. I'm starting with simple applications, however I can't seem to get a title bar. I'm using linux (elementary os). I've tried stage.initStyle(StageStyle.DECORATED);
I can't seem to find others which have had this issue. I only find those who are trying to remove the title bar. Maybe it's an operating system issue?
I'm using jdk 11 with javafx11
package sample;
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 Main extends Application implements EventHandler<ActionEvent> {
Button button;
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("title of window");
button = new Button();
button.setText("click me");
StackPane layout = new StackPane();
layout.getChildren().add(button);
Scene scene = new Scene(layout, 300, 250);
primaryStage.setScene(scene);
primaryStage.show();
}
@Override
public void handle(ActionEvent event) {
}
}