Full screen Jfxpanel inside Jframe

By Akshay Parekh

How can I make my scene to full screen inside Jframe? My Jframe is working perfectly but Panel size is fixed, I can not change it.

public Instruction() {
    System.out.println(first.tokennum);
    frame1.add(panel);
    frame1.setSize(500,500);
    frame1.setVisible(true);
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            //To change body of generated methods, choose Tools | Templates.
            initfx(panel);
        }
    });
}
public void initfx(JFXPanel panel){
    Scene scene = createscene();
    panel.setScene(scene);
    geturl(first.finallink);
}
public Scene createscene(){
    Group root = new Group();
    Scene scene=new Scene(root);
    Text text = new Text();
    text.setX(50);
    text.setY(100);
    root.getChildren().add(text);
    return (scene);
}

}

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273