Blank window when loading an image

Hello,
I'm new on Javafx, i've written the following example for loading an image, but it does not work.
Here is the code
<code>
public class Load_Image extends Application {
* @param args the command line arguments
public static void main(String[] args) {
launch(args);
@Override
public void start(Stage primaryStage) {
Rectangle rec = new Rectangle(200, 400);
ImageView iv = new ImageView(
new Image(getClass().getResourceAsStream("image.png")));
iv.setFitHeight(rec.getHeight());
iv.setFitWidth(rec.getWidth());
StackPane root = new StackPane();
root.getChildren().add(iv);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
</code>

I'm sure there is a theoretical limit, but it should be large enough to hold anything you are likely to use.
Can you open the image in other programs? Does [url http://docs.oracle.com/javafx/2.0/api/javafx/scene/image/Image.html#isError%28%29]Image.isError() return true? And where exactly have you placed the image?

Similar Messages

  • Blank window when accessing PDF via IE URL

    IE version 6.02  SP3
    Adobe Reader 9.1.3  some machines on 9.1.2
    Some folks are experiencing a blank window when they click on a PDF URL.  Some of the URLs point to a virtual directory and some point directly to a file share.  Some of the PDF files have a space in their name and some do not.  There are no error messages appearing.  Some folks have not seen this issue, others get it most of the time.  Some times a refresh will work other times it won't.
    Same results whether going through the proxy or to each web server directly.  Fiddler shows a HTTP 401 which doesn't make sense since the files are open to everyone.  Sometimes I get an IE error message saying it needs to close.
    File size is not an issue.  When I uncheck 'Display PDF in browser' the blank window issue goes away.  But before I settle on that as the solution does anyone have any other suggestions.

    I got this log from event log, anybody knows why?
      Faulting application name: java.exe, version: 5.0.110.3, time stamp: 0x45826b52
    Faulting module name: AcroPDF.dll_unloaded, version: 0.0.0.0, time stamp: 0x49a8480b
    Exception code: 0xc0000005
    Fault offset: 0x71a09550
    Faulting process id: 0xc18
    Faulting application start time: 0x01cd85884ffd4d6b
    Faulting application path: c:\program files\application\jre\bin\java.exe
    Faulting module path: AcroPDF.dll
    Report Id: d5b84c6d-f17d-11e1-8ad9-001e65fc33d2

  • Firefox 6.0 opens multiple blank windows when I restore a previous session

    Firefox 6.0 opens multiple blank windows when I restore a previous session

    Multiple tabs open when starting Firefox
    * https://support.mozilla.com/en-US/kb/Multiple%20tabs%20open%20when%20starting%20Firefox
    Restore the Default Home page
    * https://support.mozilla.com/en-US/kb/How%20to%20set%20the%20home%20page#w_restore-the-default-home-page
    Check and tell if its working.

  • Blank window when opening a link/enlarge image etc. from all websites

    Whenever I click a link in a web site to open a sub window or enlarge an image or go to another part of the site etc. a new window opens but is always blank.

    "Clear the Cache": Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"<br />
    "Remove the Cookies" from sites that cause problems: Firefox > Preferences > Privacy > Cookies: "Show Cookies"<br />
    <br />
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).<br />
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]<br />
    <br />
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.<br />
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.<br />
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")<br />

  • "Access Denied" when loading an image..

    filename=getParameter("picture" + i);
    try
    ScrollingImages.picture=this.getImage(new URL(filename));
    catch(Exception e)
    bufferGraphics.drawString("ERROR:" +e,50,70);
    Returns:
    Java.security.AccessControlException..
    I had a similar problem when loading text files, and had to use a stream tokenizer..
    How to I get around this?
    Thanks

    Hello Robertgamble,
    It looks to me like your Java program cannot get access to the files that you are trying to access. If you are running these on a Unix computer, make sure that all file permissions are set to read access. You can use the:
    chmod 744 "filename"
    or you can change the "744" to any other access permissions desired to access the file.
    If you are running this on a Windows systems, make sure that you are accessing the image from the correct path on your system.
    Hope this helps,
    Ming
    Developer Technical Support
    http://www.sun.com/developers/support

  • Exception when loading an image in ImageIcon component

    Hello,
    I want to load an image whose name or path contains special character such as accents (a french name). So that generates an exception. For exemple for an image named caf�.jpeg I obtain this message :
    java.io.FileNotFoundException: /media/disk/images/caf��.jpeg (No such file or directory)
    Can you please help me.
    Thanks in advance.

    Can you store multiple images in memory and be able
    to reference them all individually, or is it better
    to store them in a construct, such as an array and
    then loop through that when attempting to match?I'm sorry but I don't understand the question. And does it
    have anything to do with images per se? Can it be generalized
    without losing its meaning:
    Can you store multiple objects in memory and be able
    to reference them all individually, or is it better
    to store them in a construct, such as an array and
    then loop through that when attempting to match?It seems to me that multiple objects should be stored in
    an appropriate collection, if that is what is required.
    Perhaps you need to say more about what you are trying to
    do, what your goal is, to make your question meaningful.

  • CS3 - Viewing HTML in code window, when selecting  a image in design window on split mode wont work .

    Does any 1 know how i can enable my split to be able to
    select a image from the design mode window with mouse, and have it
    highlight in the code veiw.
    I have just upgraded to CS3 and in DW MX2004 i could select
    HTML from the code view , and attribute would highlight in the
    design view, and visa versa with the design mode, ..
    But atm all i can do is highlight and right click the text
    or image in the design view window when in split mode, to find the
    HTML for that selected, and it wont allow me to view the selected
    text or image in the design window, when i highlight the HTML ... i
    could do it in MX2004 , and its annoying me that i can't do this in
    CS3 ..
    Any hints on how to fix this would be very much appreciated
    Thanks in Advance

    ChAoTiC,
    That works for me on WinXP. After selecting your image in
    Design View,
    try hitting Ctrl+` on Win or Cmd+` on Mac to switch focus to
    the Code
    Pane. Does that work?
    HTH,
    Randy
    > Does any 1 know how i can enable my split to be able to
    select a image from the
    > design mode window with mouse, and have it highlight in
    the code veiw.
    >
    > I have just upgraded to CS3 and in DW MX2004 i could
    select HTML from the
    > code view , and attribute would highlight in the design
    view, and visa versa
    > with the design mode, ..
    >
    > But atm all i can do is highlight and right click the
    text or image in the
    > design view window when in split mode, to find the HTML
    for that selected, and
    > it wont allow me to view the selected text or image in
    the design window, when
    > i highlight the HTML ... i could do it in MX2004 , and
    its annoying me that i
    > can't do this in CS3 ..

  • Set "Referer" when loading an Image through Toolkit

    To load an Image using an HttpURLConnection, I use the abstract java.awt.Toolkit.getImage(URL url) method, which is implemented by sun.awt.windows.WToolkit. This method uses the HttpURLConnection to load the Image.
    The problem I have, is that I don't know how I can set the HTTP "Referer" request header. There is a method in the HttpURLConnection called setRequestProperty(String key, String value), which I could use, but I can't reach the HttpURLConnection being used to load the Image.
    I would consider another way to load Images, but that would mean quite a bit of refactoring. I would prefer not to use Reflection, though.

    I did look at the HttpsURLConnection (of which we also have our own implementation), but that still doesn't solve the problem, unfortunately.
    Is there maybe another way to load an image from an HttpURLConnection or HttpsURLConnection? If there's a way that I can provide or access the connection being used and still get an Image object, I would be a happy man!

  • ITunes causing iPods to resync to windows when loading/unloading media

    I work at a store where we retail all iPods, and we are running Windows XP, Vista and 7...when connecting an iPod, windows recognizes it as a new USB device, which is normal and expected.
    What is not expected is that the iPod is being redetected by windows when adding/removing media from the iPods...this can cause havoc with the user experience in the sense that their antivirus software usually asks to scan newly inserted USB devices...say a user drops a single song onto their iPod then a minute later drops another...rinse and repeat...this means their A/V software comes up every single time they do that...this can cause some users to throw things...like iPods! I hate to RMA these iPods...and I'd image that Apple doesn't want to receive them either!
    Help me stop abuse to helpless iPods lol
    Message was edited by: dancelot

    I work at a store where we retail all iPods, and we are running Windows XP, Vista and 7...when connecting an iPod, windows recognizes it as a new USB device, which is normal and expected.
    What is not expected is that the iPod is being redetected by windows when adding/removing media from the iPods...this can cause havoc with the user experience in the sense that their antivirus software usually asks to scan newly inserted USB devices...say a user drops a single song onto their iPod then a minute later drops another...rinse and repeat...this means their A/V software comes up every single time they do that...this can cause some users to throw things...like iPods! I hate to RMA these iPods...and I'd image that Apple doesn't want to receive them either!
    Help me stop abuse to helpless iPods lol
    Message was edited by: dancelot

  • WDS capture stuck at windows is loading files image.wim

    Hello,
    We have a new Dell XPS 13 that I have built up for Windows 7, I want to capture the image using PXE boot to our server.
    However, after I press F12 and get the the screen "Windows is loading files..." the screen seems to just hang at one point with the text below "IP: 192.168.3.252, File: \boot\x64\Images\capture image.wim"
    Any suggestions would be great.
    Thanks
    Ash

    You are best posting this to a WDS forum as ConfigMgr does not use the capture image methodology that native WDS does. Speaking of which though, why are you using native WDS instead of MDT? MDT is far more powerful and is actually easier to use than native
    WDS.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Blank window when starting REminiscence

    when I start reminiscence (an old dos/amiga) game, all I get is a blank (black) window...
    reminisicence aur packet should download and extract all the necessary dos files (and it does) - but the game won't start. dos files are located in /usr/share/reminiscence, I even tried replacing them with another set of dos flashback files but I still get the same result...
    i tried starting the game as root and as a regular user through konsole, and using alt+f2... even tried playing with permissions and ownership, but nothing helped..
    hints?
    maybe if someone would be kind enough to try this packet out and see what kind of a result he gets? or if someone already tried it, and could share his experience?
    thank you

    yes, I use KDE. tried it out without effects.. still everything is the same.
    one more thing - while the reminiscence blank window is opened - one core of my cpu goes to 100%, so it's doing something..
    as I read more on the internet, I suspect it might have something to do with reminiscence dependency - SDL which is: "Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. It is used by MPEG playback software, emulators, and many popular games"
    Last edited by pootzko (2011-07-16 15:30:47)

  • Blank window when connecting to public wireless network

    I'm having trouble connecting my Macbook Pro to the wireless network at my folks' nursing home. The MBP can see the private and public networks, but when I try to connect to the public network, a blank window pops up - no text or buttons. My nephew's Windows laptop connects with no problems. I'm running 10.7 (Lion). Any ideas?

    A guess would be that your university uses a different encryption than your home wireless and that your driver has problems with that. If you search this bbs with your driver's name (and that encryption), you will also encounter a number of freeze problems when using newer kernels. However, those drivers and kernels move quick, so if you see an error in a post from 2 months ago, the error might have vanished already.
    Second, you should find out the card you are using with
    lspci -nn | grep Realtek

  • Version 15 has left me with blank windows when I enter an address

    Blank windows in beta 15--how do I go back to previous version and get off beta list?

    You can go back to the release version of Firefox by downloading and installing it from mozilla.org/firefox
    Detailed instructions here - [[Install Firefox on Mac]]

  • GMail in Safari w/FluidApp opens up blank window when clicking externally

    I'm currently using FluidApp to create a stand-alone instance of GMail in Safari. This works great for quickly switching to GMail as I can just type G using Quicksilver and I'm there right away.
    However, I'm noticing something annoying in that whenever I click a link in my email to an external website Safari opens up another window that I need to close in addition to wherever the website opened. So my path basically goes GMail > view external website > leave external website to return to GMail > close annoying blank window > Go back to GMail.
    Any idea why this is happening?

    You should check Preferences > General to see that you've enabled the "Open links from applications:" in a new tab in the current window. Then restart Safari and test to see if the problem is resolved.
    Mulder

  • Hide the database connection window when load a report in a viewer control

    When I load a report in viewer and the datasource is empty always appears a window for connect to database. How I can hide ALWAYS that window. Is possible? I did see some ways for do it, at before versions of CR, but seems don´t works in last version of Crystal Reports for .NET.
    Anyway, is possible show a default text in viewer for information to user than don´t exists data?
    Many thanks for the help, and excuse me my poor english.

    The structure of XML is that: http://slexy.org/view/s20h0LVX1b
    The XSD showed is used for the design of report.
    In the empty datas the prompt dialog appears. The XML is different depend of context from application.
    When I have the XML then load it in a DataSet object, and call the SetDataSource method from ReportDocument. In that moment ReportDocument don´t have any information over his state? Exists some way for know if will need extra information from user through the prompt dialog? In that case I could load another report with "NO DATA" text, but I don´t have info.
    For example, is possible override the behavior from Crystal report viewer for show a different window? I did see events but nobody works for me.
    Many thanks for the help and excuse me for my poor english.

Maybe you are looking for

  • TC for open purchase orders ?

    Dear All, What r the std.Tcodes to see Pending list of purchase orders in MM ? Thanks.

  • Trigger badi after giving data in custom tab of po item

    Hi, We have added custom tab in po item level, now we want to make those fields manditory for specific document type.We are using badi ME_PROCESS_PO_CUST . The message is getting triggered initially , but after giving data in the custom fields the ba

  • Pan and zoom

    trying to pan and zoom within still image frame ken burns style. Any suggestions? Thanks

  • Dreamweaver Linking to Anchor Point

    I am using Dreamweaver CS3 and am trying to link from an image to an anchor point on the same web page and play a flash video. I have followed the recommended way to create the anchor point and use the "#anchor point name" after the link to play my v

  • I can only see Inbox and not any other boxes (eg outbox, drafts, sent...)

    Thunderbird has been running OK for months but now I can only see my outbox. I cannot see any way to see anything else! I'd really like to get back to the display that shows the whole list of 'boxes' in, out, etc, and my custom name boxes. These usua