-
Bug
-
Resolution: Fixed
-
P3
-
8
-
Java 8b116, Win7
When setting a graphic for a MenuButton the size of the imageView is ignored. Execute the test case below, the size of both images should be equal - in Java8b106 it works fine, in Java8b116 the MenuButton ignores the fitHeight setting for some reason. I don't know which release introduced the issue because I haven't tested all releases between the mentioned.
public class MenuButtonGraphicsTest extends Application
{
public static void main(String[] args)
{
Application.launch(args);
}
@Override
public void start(Stage stage)
{
System.err.println(System.getProperty("javafx.runtime.version"));
Scene scene = new Scene(createContentPane(), 400, 300);
stage.setScene(scene);
stage.setTitle(getClass().getSimpleName());
stage.show();
}
private Parent createContentPane()
{
Pane content = new FlowPane(10, 10);
MenuButton menuButton = new MenuButton();
ImageView imageView = new ImageView(getClass().getResource("/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Background-Color-Black@2x.png").toExternalForm());
imageView.setFitHeight(16);
menuButton.setGraphic(imageView);
content.getChildren().add(menuButton);
ImageView imageView2 = new ImageView(getClass().getResource("/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Background-Color-Black@2x.png").toExternalForm());
imageView2.setFitHeight(16);
content.getChildren().add(imageView2);
return content;
}
}
public class MenuButtonGraphicsTest extends Application
{
public static void main(String[] args)
{
Application.launch(args);
}
@Override
public void start(Stage stage)
{
System.err.println(System.getProperty("javafx.runtime.version"));
Scene scene = new Scene(createContentPane(), 400, 300);
stage.setScene(scene);
stage.setTitle(getClass().getSimpleName());
stage.show();
}
private Parent createContentPane()
{
Pane content = new FlowPane(10, 10);
MenuButton menuButton = new MenuButton();
ImageView imageView = new ImageView(getClass().getResource("/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Background-Color-Black@2x.png").toExternalForm());
imageView.setFitHeight(16);
menuButton.setGraphic(imageView);
content.getChildren().add(menuButton);
ImageView imageView2 = new ImageView(getClass().getResource("/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Background-Color-Black@2x.png").toExternalForm());
imageView2.setFitHeight(16);
content.getChildren().add(imageView2);
return content;
}
}
- relates to
-
JDK-8123589 CSS - User Agent precedence issue
- Closed