Skip to content

Instantly share code, notes, and snippets.

Created September 1, 2015 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/083229aa670a5c65024a to your computer and use it in GitHub Desktop.
Save anonymous/083229aa670a5c65024a to your computer and use it in GitHub Desktop.
import com.lynden.glitter.animation.ResizeHeightTranslation;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.animation.FadeTransition;
import javafx.animation.SequentialTransition;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TableView;
import javafx.scene.layout.Pane;
import javafx.util.Duration;
public class FXMLController implements Initializable {
@FXML
private Button clickMeButton;
@FXML
private Pane contentPane;
@FXML
private void handleButtonAction(ActionEvent event) {
TableView tableView = new TableView();
tableView.setMaxHeight(250);
tableView.setMinHeight(250);
ResizeHeightTranslation rht = new ResizeHeightTranslation(Duration.millis(1000), contentPane, tableView.getMinHeight() );
FadeTransition ft = new FadeTransition(Duration.millis(1000), tableView);
ft.setFromValue(0);
ft.setToValue(1);
SequentialTransition pt = new SequentialTransition(rht, ft);
pt.play();
contentPane.getChildren().add(tableView);
}
@Override
public void initialize(URL url, ResourceBundle rb) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment