Details
-
Bug
-
Resolution: Fixed
-
P3
-
7u45
-
Windows 7, JDK 7 update 45
Description
The comboBox popup is not maintaining its position with respect to the comboBox control, when the user does a scroll with mouse.
Do the below steps after running the application:
1) Click on combobox to show the options popup.
2) Move the mouse outside (over scrollpane) and do the mouse scroll.
3) The combobox is moved where as the popup stays. This gets confused if I have more comboboxes in the form.
import java.util.Arrays;
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.control.ScrollPaneBuilder;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.StackPaneBuilder;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class ComboBoxPopupIssue extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage stage) throws Exception {
ComboBox<String> comboBox = new ComboBox<>();
comboBox.setItems(FXCollections.observableArrayList(Arrays.asList("One", "Two", "Three")));
StackPane root = new StackPane();
root.getChildren().add(
ScrollPaneBuilder
.create()
.fitToHeight(true)
.fitToWidth(true)
.content(
StackPaneBuilder.create().minHeight(600).padding(new Insets(50, 20, 20, 20)).alignment(Pos.TOP_LEFT)
.children(comboBox).build()).build());
Scene scene = new Scene(root, Color.LINEN);
stage.setTitle(this.getClass().getSimpleName());
stage.setWidth(500);
stage.setHeight(500);
stage.setScene(scene);
stage.show();
}
}
Do the below steps after running the application:
1) Click on combobox to show the options popup.
2) Move the mouse outside (over scrollpane) and do the mouse scroll.
3) The combobox is moved where as the popup stays. This gets confused if I have more comboboxes in the form.
import java.util.Arrays;
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.control.ScrollPaneBuilder;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.StackPaneBuilder;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class ComboBoxPopupIssue extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage stage) throws Exception {
ComboBox<String> comboBox = new ComboBox<>();
comboBox.setItems(FXCollections.observableArrayList(Arrays.asList("One", "Two", "Three")));
StackPane root = new StackPane();
root.getChildren().add(
ScrollPaneBuilder
.create()
.fitToHeight(true)
.fitToWidth(true)
.content(
StackPaneBuilder.create().minHeight(600).padding(new Insets(50, 20, 20, 20)).alignment(Pos.TOP_LEFT)
.children(comboBox).build()).build());
Scene scene = new Scene(root, Color.LINEN);
stage.setTitle(this.getClass().getSimpleName());
stage.setWidth(500);
stage.setHeight(500);
stage.setScene(scene);
stage.show();
}
}
Attachments
Issue Links
- duplicates
-
JDK-8092655 JavaFX has problems with popups, for example Combobox, by using in Swing
- Resolved
- relates to
-
JDK-8113918 Mac: tooltips disappear right after they are displayed
- Resolved