Note that there are some explanatory texts on larger screens.

plurals
  1. POPlaying multiple videos JavaFx
    primarykey
    data
    text
    <p>I am totally new on JavaFx, I have a vbox with 3 ToggleButtons, When I click a Button a video will start playing on an another layout with 3 columns so I can play 3 videos on that layout by clicking the 3 ToggleButtons. I didn't found any help with tutorials. Can anyone suggest how to do it? Here's my 3 buttons code</p> <pre><code> private static Scene createScene() { Group root = new Group(); Scene scene = new Scene(root); // Création du layout pour les vidéos ainsi que du media builder pour // construire les vidéos VBox gridpane = new VBox(0.4); gridpane.setMaxWidth(Double.MAX_VALUE); gridpane.setStyle("-fx-border-style: solid;" + "-fx-border-width: 1;" + "-fx-border-color: black"); Image progress = new Image(mediaplayer.class.getResourceAsStream("/cameras_images/im1.jpg")); Image im2 = new Image(mediaplayer.class.getResourceAsStream("/cameras_images/im2.jpg")); Image im3 = new Image(mediaplayer.class.getResourceAsStream("/cameras_images/im3.jpg")); ToggleButton bouton1 = new ToggleButton(" 1 ",new ImageView(progress)); bouton1.setContentDisplay(ContentDisplay.RIGHT); ToggleButton bouton2 = new ToggleButton(" 2 ",new ImageView(im2)); bouton2.setContentDisplay(ContentDisplay.RIGHT); bouton2.setMaxWidth(Double.MAX_VALUE); ToggleButton bouton3 = new ToggleButton(" 3 ",new ImageView(im3)); bouton3.setContentDisplay(ContentDisplay.RIGHT); bouton3.setMaxWidth(Double.MAX_VALUE); gridpane.getChildren().add(bouton1); gridpane.getChildren().add(bouton2); gridpane.getChildren().add(bouton3); root.getChildren().add(gridpane); return (scene); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload