FXML: fx:include / with resources attribute. How does it work?

Hi,
I am trying to understand FXML and I have trouble with using ResourceBundles / internationalization.
I've made a common component, which relies on its own resource file, let's say in package "fxml", I have:
Control.fxml
Control.properties
Control_de.properties
Another FXML includes that one:
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<fx:root type="javafx.scene.layout.VBox" xmlns:fx="http://javafx.com/fxml">
    <TextField fx:id="textField"/>
    <fx:include source="/fxml/Control.fxml" resources="fxml.Control" />
</fx:root>
If I load that one via:
Parent loginView = FXMLLoader.load(getClass().getResource("/fxml/Login.fxml"), ResourceBundle.getBundle("fxml.Login"));
I get the following exception:
Caused by: java.lang.NullPointerException
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:1026)
    at javafx.fxml.FXMLLoader$IncludeElement.processAttribute(FXMLLoader.java:897)
    at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:180)
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:563)
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2348)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2164)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2061)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2778)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2757)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2743)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2730)
    at fxml.JavaFXApp.start(JavaFXApp.java:19)
What's wrong here? fxml.Control.properties definitively exists.
If I remove the <fx:include/> element, everything works fine.
Is there a possibility to include resources directly in a FXML, so that I don't have to specify them again and again in every include?

Would the non-static FXMLLoader#load method work for you?
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(controller.getClass().getResource("/fxml/Login.fxml"));
// Attempt to load resources if they exist
try {
  ResourceBundle resourceBundle = ResourceBundle.getBundle("fxml.Login");
  fxmlLoader.setResources(resourceBundle);
catch (MissingResourceException e) {
  // TODO Log information about the missing bundle
fxmlLoader.load();

Similar Messages

  • The special offer for the printer that is going on with a Mac, how does that work? Is it true i can get a free printer?

    The special offer for the printer that is going on with a Mac, how does that work? Is it true i can get a free printer?

    you pay for it up front, and they give you a rebate or $99, so if you buy a $99 printer from them (Epson Stylus NX430 Small-in-One Color Inkjet Printer $99.95) then the printer becomes free. You can not get this deal unless you also buy a mac with it.

  • We have several i componets with different users how does that work with the mac

    we only have one computer, so how does the cloud keep them seperate or does everyone know what everyoe is doing ?

    By different Apple IDs for data. For device it's the device names you've given them.

  • Hyperlinks with InDesing CS3, how does it work?

    Hello There,
    I am creating a document with ID SC3 and would like to add links to the exported PDF that are active, so people can check material I have on the web.
    So far I have tried selecting the Object and then going to the Hyperlink Options from the panels to add a link. Under destination, I went:
    Type: URL
    Name: Seattle Post blablabla
    URL: http://www.visionsofthewild.com/pdf/F.SchulzSeattlePI.pdf
    but the link is not active when I open the exported PDF. There is no hand showing that there is a link.
    I also made the test to see if I place just the text like
    http://www.visionsofthewild.com/pdf/F.SchulzSeattlePI.pdf
    the link is active, but not the whole thing, just one part because the text frame was too small and the rest of the link jumped to the next line.
    I am not trying to create an HTML or website, I just want to have links that are active, without having to write the entire http://www.blablabla.com
    What am I missing?
    Here is a link to one of the pages of the file I exported:
    http://www.visionsofthewild.com/interviews/Schulz_Report.pdf
    One can see that the www.visionsofhewild.com text is active, but the large file on the left is not showing sings of active links even though I have already applied one. What am I doing wrong?
    Advice is greatly appreciated!
    Thanks,
    Emil

    Hello Richard
    I have created the hyperlink destination and then created the new hyperlink. But it is still not showing me any activ links on the final PDF :-S
    On the Hyperlink window, I have under Destination:
    Document: -> Here is the name of the document where I am editing the hyperlinks and so on.
    Type: URL
    Name: -> Here appears the name of the Hyperlink destination I already created, and it is already selected
    URL: -> It is also the same as I have created on the new destination.
    Apperance: ->Here I have not changed anything, do I need to?
    What would be another reason why the hyperlink doesn't want to show. I have already clicked on "Go to destination" and it is the right link, so I am not sure what I am doing wrong.
    Any other ideas?
    Thank your your quick reply too :-)

  • Airport Express with Time Capsule: How does it work?

    I don't know much about newtorking but wanted to ask this:
    I am considering buying a 1tb Time Capsule. I use Airport Express now so I can stream iTunes to my home entertainment system. Is the configuration supposed to be this? See below:
    -Plug the Time Capsule into the cable modem for internet access
    -Plug the APE into the Time Capsule with (ethernet? USB?) to power its Air Tunes capabilities
    I would love to gain the back up and simplicity of Time Capsule but I am not giving up Air Tunes.
    Any replies appreciated. Thanks.

    So it sounds like I should just leave Airport Express as my networking hub/internet connection point, and let Time Capsule acquire a spot on the network, then I can access it that way.
    I guess I thought that Time Capsule had to be the primary router/internet connection for the network, and Airport Express would become sub to that.
    I think I prefer the first option over my idea.
    Thanks for the response.

  • How does Remote work with Apple TV?

    How does Remote work with Apple TV?
    1. Does Remote, "Play" the music that resides on your iPod Touch>Apple TV>Home Speakers.
    OR
    Does Remote "Control" the music that resides on Apple TV HD>Home Speakers.
    (If so... say you have a iPod Touch that only holds 8GB's but your music collection on your Apple TV exceeds that amount.
    Will Remote still "Control" the larger music collection on Apple TV or your computer?)
    2. Will iPod Wifi work on a patio outside a home to control Apple TV inside the home?
    thank you in advance, Tom

    Remote is a way to control iTunes on either your computer or Apple TV using a WiFi connection. See this article for complete instructions.

  • Itunes 11.1.5 will not sync new apps with iPhone 5 iOS 7.0.6 and gives grayed out "install" no message?  How does one work around this?

    Itunes 11.1.5 (MacBook Pro,OS 10.6.8) will not sync new apps with iPhone 5 iOS 7.0.6 and gives grayed out "install" no message?  How does one work around this?

    Just reboot your laptop... While its rebooting try to reboot your phone also by holding the home and power buttonn for 10-15 seconds...When your phone is turned off try to connect it to iTunes and it will recognize your phone in recovery mode.
    If you have the .ipsw file for iOS 7.0.6 saved in your desktop then in itunes press shift and click on Restore.
    Select the ipsw file and let it restore.
    If you dont have it downloaded then simply click on restore.
    I hope it works
    Cheers !

  • I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    Can you supply a link?

  • How does it work? SuperDrive with double-layer support

    Hi,
    Can anyone help me? I own a macbook with SuperDrive with double-layer support. I want to try to burn a dvd with the dual layer, how does this work? Which applications do i need? I have been searching for info on this subject but havent succeeded so far..

    Any standard burning application such as Toast (or OS Xs built in burning) will burn a dual layer disk. You don't need to do anything special... it will just see the disk with double the capacity. What you do need to do is get dual layer DVDs. They're not all that easy to find at many retail stores, but they're pretty easy to find online.

  • Now what do I do with this?  How does this solve my problem?

    Now what do I do with this?  How does this solve my problem with Adobe Photoshop Elements 10

    And exactly what? You need to be a lot more specific.
    Mylenium

  • Lightroom comes with a recently purchased camera, but no instructions or info is included with the camera. how do I get this software?

    lightroom comes with a recently purchased camera, but no instructions or info is included with the camera. how do I get this software?

    Ask the people who sold you the camera and lightroom. They should send you details.
    Bob frost

  • How does QoS work with WAAS WCCP? What's the interaction between QoS Traffic Classification and WAE Traffic Application Policy?

    How does QoS work with WAAS WCCP? What's the interaction between Router QoS Traffic Classification and WAE Traffic Application Policy?

    By default, WAAS preserves the DSCP marking on intercepted packets.  There is a configuration option to set/override the DSCP value at the global (device), application, and classifier levels.  Currently WAAS provides marking only.  There is no action taken by WAAS based on the DSCP value.
    Regards,
    Zach

  • I have a Powerbook G4 (don't laugh) with iPhoto '08. How does iCloud work with my computer. I have a iPhone 4 that has iCloud.

    I have a Powerbook G4 (don't laugh) with iPhoto '08. How does iCloud work with my computer. I have a iPhone 4 that has iCloud. Is iCloud pushing my phone's PhotoStream to my computer if it doesn't have the latest OS? Thanks so much for whoever can help!

    iCloud will not work with your computer because iCloud requires Lion. Lion requires an Intel Core 2 Duo processor or better. For you to have iCloud and PhotoStream you would need to buy a newer Mac Intel model meeting the requirements for Lion:
    Lion System Requirements
    Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    2GB of memory
    OS X v10.6.6 or later (v10.6.8 recommended)
    7GB of available space
    Some features require an Apple ID; terms apply.

  • How does lion work with logic 9.1.4?

    how does lion work with logic 9.1.4?

    Greetings,
    So far, everything seems as stable as before.  Which doesn't actually mean its rock solid, but otherwise workable.  I'm running a Focusrite Saffire Pro 24DSP with beta audio drivers.  So far, everything is running well.  I decided to jump into the 64bit work environment with Logic.  I have yet to encounter huge problems with the 32bit audio bridge.  Just making sure I bounce everything that is 32bit.
    As for everything else within Logic, I can't say I hate Lion.  Matter of fact, Lion seems buggier than Logic at the moment.  Logic handles well in Lion, but Lion on its own overall is a different can of worms.  I am mixed about a 10.7.1 update.  Usually, it fixes something on the OS, but breaks something else in Logic.
    I have faith that Lion will turn out to be as solid as Snow Leopard.  SL was my favorite OSX so far.  Lion still leaves allot to be desired in terms of stability.
    Again, answer to your question:  for me, Logic and Lion play nice.............for now.
    LGK

  • TS1292 How do I redeem a card with a code that does not work?  The support store takes me in circles?

    Help and support sends you in circles and does not help redeem a card with a code that does not work.

    Well, they have a website, but here is a link to their information about unlocking iPhones.
    http://www.att.com/esupport/article.jsp?sid=KB414532&cv=820#fbid=6d7EKuCF_dr
    You may not qualify for an unlock though.

Maybe you are looking for

  • Are there any screen readers available for Mac?

    I've been diagnosed with cataracts, and at least for the short term, I need something to help read screens, documents, etc. Is there something built into my Mac or do I need to look externally? Thanks in advance for any help! Cindy

  • Spell Check for Memos in KM

    Hi I have seen & used the spell check for threads with memos on sdn When will this be delivered as part of the functionlity in KM in EP6? Regards Arun

  • Install Failed on Mac Leopard

    I'm trying install Lightroom 2.1 on Mac OSX Leopard. Lightroom has never been installed on this computer. I am on a Macbook Pro 15'' and my computer meets all the requirements. It's giving me the following error: Install Failed! The following install

  • Left rear channel not working - Xfi

    My left rear channel is not working. Its not the speakers nor the connections, its the soundcard (Xfi XM). I know this because I switched the front/rear connections to test them and the same problem?channel did not work. The problem is in both Vista

  • Hard drive not loading, done AP test

    I Have an iPod Classic 80GB, purchased in 2007.  all I'm getting on the screen is a circle with a cross in it.  Have done the AP tests and the hard drive is not loading.