Skip to main content

Trying to load fxd problems

2 replies [Last post]
mambobanda
Offline
Joined: 2009-01-21

hi
I have been looking at examples on how to load fxd/fxz files. Here is a link to the fxz file:http://www.savefile.com/files/1975998.

I load the file fine, using FXDLoader.load() and add it to a group using insert icon into group.content. When I add the group to the scene content, nothing shows on the screen. Is there a step I'm missing?

A code sample would be nice if possible.

MB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mambobanda
Offline
Joined: 2009-01-21

Thanks, that worked. It was just my sloppy coding:) Forgot to initialize the group variable.

MB

pbenes
Offline
Joined: 2009-01-22

Hi,
the following JavaFX code fragment shows your file:

[i]var icon = FXDLoader.load( "file://c:/_f/quit.fxz");
var group = Group{}
insert icon into group.content;

Stage {
title: "FXDLoader"
scene: Scene {
content: [
group
]
}
}[/i]

Please note, that since FXDLoader is not part of JavaFX runtime yet, the fxdloader library (called JavaFX FXD 1.0 in NetBeans) must be included to compile and run the sample.

Regards,

Pavel