Skip to Main Content

JavaFX ListView ScaleTransition Greying Out

3199987Mar 16 2016 — edited Mar 16 2016

Hi everyone, first post here, and I am hoping you guys can help me out. I have programmed a ListView that shows and hides itself on a toggle button in a menu. It worked completely fine, showing and hiding it by just adjusting it's MaxSize if the button was enable or disabled. But I tried to use the ScaleTransition to scale it up from a MaxSize(0, 0) to its new MaxSize. The animation works, but when the ListView reaches its new MaxSize, it is just greyed out. This is the important parts of this problem that I have,

   browserView = new WebView();

  historyList = new ListView<String>();

  observableList = FXCollections.observableArrayList();

  webPageLayout = new StackPane();

  History = new CheckMenuItem("Show History");

  historyList.setItems(observableList);

  historyList.setMaxSize(0, 0);

  StackPane.setAlignment(historyList, Pos.BOTTOM_RIGHT);

 

  webPageLayout.getChildren().addAll(browserView, historyList);

History.setOnAction(event -> {

   BooleanProperty selected = History.selectedProperty();

   if(selected.toString().contains("false")){

    ScaleTransition scale = new ScaleTransition(Duration.millis(100), historyList);

    scale.setFromX(browserView.getWidth()/4);

    scale.setFromY(browserView.getHeight());

    scale.setToX(0);

    scale.setToY(0);

    ParallelTransition parallel = new ParallelTransition(scale);

    parallel.play();

   }

   if(selected.toString().contains("true")){

    ScaleTransition scale = new ScaleTransition(Duration.millis(100), historyList);

    scale.setFromX(0);

    scale.setFromY(0);

    scale.setToX(browserView.getWidth()/4);

    scale.setToY(browserView.getHeight());

    ParallelTransition parallel = new ParallelTransition(scale);

    parallel.play();

   }

  });

Comments
Post Details
Added on Mar 16 2016
0 comments
437 views