Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8429677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:24:10+00:00 2026-06-10T05:24:10+00:00

I am trying to display three images in sequence with some scale transformation to

  • 0

I am trying to display three images in sequence with some scale transformation to each of them(images of 1,2,3). I am using ScaleTransition on single instance of imageview, after each successive transformation the imageView height get scaled which is not resetting
My Code is

    public void start(Stage primaryStage) {

    final IntegerProperty intProperty = new SimpleIntegerProperty(0);
    final Image[] array = {
            (new Image(WaitEffect.class.getResource("1.png")
                    .toExternalForm())),
            (new Image(WaitEffect.class.getResource("2.png")
                    .toExternalForm())),
            (new Image(WaitEffect.class.getResource("3.png")
                    .toExternalForm())) };
    Group root = new Group();

    Scene scene = new Scene(root, 400, 400, Color.BLACK);
    StackPane pane = StackPaneBuilder.create()
            .layoutX(scene.getWidth() / 2).layoutY(scene.getHeight() / 2)
            .build();
    final ImageView imageView = new ImageView();
    pane.getChildren().add(imageView);
    Timeline timeline = new Timeline();
    int count = 0;
    KeyValue value = new KeyValue(intProperty, count++);
    KeyFrame frame = new KeyFrame(Duration.millis(2000),
            new EventHandler<ActionEvent>() {
                int co = 0;

                @Override
                public void handle(ActionEvent paramT) {
                    imageView.setImage(array[co]);

                    ScaleTransition st = ScaleTransitionBuilder.create()
                            .byX(2).byY(2).node(imageView)
                            .duration(Duration.millis(500)).build();
                    st.play();
                    imageView.setFitHeight(150);
                    imageView.setFitWidth(150);
                    imageView.resize(150, 150);
                    co++;
                }
            }, value);

    timeline.getKeyFrames().add(frame);
    timeline.setCycleCount(3);
    timeline.play();

    root.getChildren().addAll(pane);
    primaryStage.setScene(scene);

    primaryStage.show();
}`
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:24:12+00:00Added an answer on June 10, 2026 at 5:24 am

    ImageView doesn’t reset it’s properties after setting new Image. You need to reset it yourself, e.g. by setting from properties of ScaleTransition:

    ScaleTransition st = ScaleTransitionBuilder.create()
        .fromX(1).fromY(1)
        .byX(2).byY(2).node(imageView)
        .duration(Duration.millis(500)).build();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display a set of images from my database using image_tag ,
I am trying to display three forms in one template. I have the forms
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
Im trying to display some files in a web page so the user can
I'm trying to display all the 'legs' for each of my 'trips' in my
I'm trying to retrieve images from a folder using glob() and i want it
I am trying to display sets of images with up and down navigation in
I'm trying to apply some CIFilters to a sequence of CIImage and would like
I'm trying to display a number of images horizontally inside of a fixed-width div.
I am trying to display random banner each time the user refresh the page.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.