-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
Windows 7 64b
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8170874 | 8u152 | Jim Graham | P3 | Resolved | Fixed | b01 |
Run this sample program :
"
import javafx.animation.TranslateTransition;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import javafx.util.Duration;
public class testTranslate extends Application {
@Override
public void start(Stage primaryStage) {
MenuBar bar =new MenuBar();
for(int i =0;i<5; ++i){
Menu menu = new Menu("test");
for(int j =0;j<5; ++j){
MenuItem item = new MenuItem("test");
menu.getItems().add(item);
}
bar.getMenus().add(menu);
}
Label label = new Label("this is a test");
TranslateTransition transition = new TranslateTransition(Duration.seconds(2), label);
transition.setFromX(0);
transition.setToX(1000);
transition.setCycleCount(-1);
transition.play();
BorderPane pane = new BorderPane(label);
pane.setTop(bar);
pane.setMinWidth(1000);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(new Scene(pane));
primaryStage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
"
Click on one Menu, it appears immediately. Move your mouse on the other Menu, they all appear immediately.
Now, resize the height of the window by grabbing the bottom. Resize the window by shrinking its height and enlarging it slowly like a user would. Repeat 5-6 times.
Now try to open a Menu again, it is VERY slow to open. Why?
What is the work-around for that?
"
import javafx.animation.TranslateTransition;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import javafx.util.Duration;
public class testTranslate extends Application {
@Override
public void start(Stage primaryStage) {
MenuBar bar =new MenuBar();
for(int i =0;i<5; ++i){
Menu menu = new Menu("test");
for(int j =0;j<5; ++j){
MenuItem item = new MenuItem("test");
menu.getItems().add(item);
}
bar.getMenus().add(menu);
}
Label label = new Label("this is a test");
TranslateTransition transition = new TranslateTransition(Duration.seconds(2), label);
transition.setFromX(0);
transition.setToX(1000);
transition.setCycleCount(-1);
transition.play();
BorderPane pane = new BorderPane(label);
pane.setTop(bar);
pane.setMinWidth(1000);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(new Scene(pane));
primaryStage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
"
Click on one Menu, it appears immediately. Move your mouse on the other Menu, they all appear immediately.
Now, resize the height of the window by grabbing the bottom. Resize the window by shrinking its height and enlarging it slowly like a user would. Repeat 5-6 times.
Now try to open a Menu again, it is VERY slow to open. Why?
What is the work-around for that?
- backported by
-
JDK-8170874 Menu slow to respond after resizing a window multiple times with animation running
-
- Resolved
-
- duplicates
-
JDK-8170459 Indeterminate ProgressIndicator degrades performance if stage changed
-
- Closed
-