Issue RT-14027 (http://javafx-jira.kenai.com/browse/RT-14027) is marked as Resolved, however in Build 42 I am seeing the behaviour of the original poster.
My classpath directory structure looks like this:
/stylesheet.css
/images/my-image.png
/com/zonski/jfx/TestApplication.class
stylesheet.css:
.imageView {
-fx-image: url("images/my-image.png");
-fx-cursor: hand;
}
TestApplication.java:
public class TestApplication extends Application
{
public static void main(String[] args)
{
Application.launch(TestApplication.class, args);
}
public void start(Stage stage) throws Exception
{
VBox box = new VBox();
ImageView imageView = new ImageView();
imageView.getStyleClass().add("imageView");
box.getChildren().add(imageView);
Scene scene = new Scene(box);
scene.getStylesheets().add("stylesheet.css");
stage.setScene(scene);
stage.setWidth(1024);
stage.setHeight(768);
stage.show();
}
}
Some interesting things of note:
* If I set the image explicitly in code (using imageView.setImage(new Image(getClass().getResourceAsStream("images/my-image.png"), I still don't see my image
* If I remove the -fx-image attribute however _and_ set the image in code I do see my image (and the 'hand' cursor appears when I mouse over it.
My classpath directory structure looks like this:
/stylesheet.css
/images/my-image.png
/com/zonski/jfx/TestApplication.class
stylesheet.css:
.imageView {
-fx-image: url("images/my-image.png");
-fx-cursor: hand;
}
TestApplication.java:
public class TestApplication extends Application
{
public static void main(String[] args)
{
Application.launch(TestApplication.class, args);
}
public void start(Stage stage) throws Exception
{
VBox box = new VBox();
ImageView imageView = new ImageView();
imageView.getStyleClass().add("imageView");
box.getChildren().add(imageView);
Scene scene = new Scene(box);
scene.getStylesheets().add("stylesheet.css");
stage.setScene(scene);
stage.setWidth(1024);
stage.setHeight(768);
stage.show();
}
}
Some interesting things of note:
* If I set the image explicitly in code (using imageView.setImage(new Image(getClass().getResourceAsStream("images/my-image.png"), I still don't see my image
* If I remove the -fx-image attribute however _and_ set the image in code I do see my image (and the 'hand' cursor appears when I mouse over it.