I'm a bit new to Java and JavaFX, so I'm sure this is an easy fix. First the context - I've written a program to list TIFF files and make them viewable in a little popup window. Here is the code for that window:
When the new stage appears it is completely empty. I've spent a bit of time on this and I think my problem lies in one of two places: I have specified the file path incorrectly (though this is the only variation that doesn't throw an exception), OR I have incorrectly formed the UI components and something isn't attaching to the scene/stage.
Even if someone can tell me definitively which of the two it is it would be a great help, then I'm only diving down one rabbit hole...
A new stage will automatically size itself to it's content, so although it does no harm, you don't need the calls:
Check and see if there was an error loading the image:
You could place a \ at the beginning of the local image path, e.g. "\\C:\\ProgramFiles\\ImageViewer\\someTiff.tif", but it worked both with and without the leading \ for me. Note the double slashes \\ in the string constant to escape the \ character.
Here is a complete sample I used which worked for me:
John Damien Smith
Joined: Jan 26, 2012
Ah just realized, you are trying to load a TIFF file, which is not an image format which JavaFX understands.