[Solved] How can i add movable objects inside a jpg pic?


Not sure if I understood you correctly, but I suppose you want to display background (a JPG image) and then programatically move three beads on it. If that’s the case, there’s Simple tutorial on how to work with images in JavaFX. To just display image, you need to do the following:

public void start(Stage stage) throws FileNotFoundException {
    //Creating an image 
    Image image = new Image(new FileInputStream("file path"));

    //Setting the image view 1 
    ImageView imageView1 = new ImageView(image); 

    //Creating a Group object  
    Group root = new Group(imageView1);  

    //Creating a scene object 
    Scene scene = new Scene(root, 600, 400);  

    //Adding scene to the stage 
    stage.setScene(scene);  

    //Displaying the contents of the stage
    stage.show(); 
}

To move beads, you need to keep their state in your application and re-draw it periodically. The tutorial I’ve mentioned describes basics of pixel manipulation so you may want to check that too.

solved How can i add movable objects inside a jpg pic?