Skip to main content

import vs full package name

1 reply [Last post]
tbee
Offline
Joined: 2003-07-23

So, I decided to fumble a bit with JavaFX. After having gotten myself a sh*tload of stress doing stuff in Flash and Actionscript, I'm ready for something that is intended as "code" from the ground up.

One thing I ran into is this: I have two identical custom nodes (AFAIK), the only difference is that one uses full package names and the other uses imports. (The components just show an image.)

Full package version:

public class SfeerNode extends javafx.scene.CustomNode {
public var sfeerimage : javafx.scene.image.Image;

override function create() : javafx.scene.Node {
return javafx.scene.Group {
content: [ javafx.scene.image.ImageView {
image: sfeerimage
}
]
};
}
}

And the import version


import javafx.scene.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;

public class SfeerNode2 extends CustomNode {
public var sfeerimage : javafx.scene.image.Image;

override function create() : Node {
return Group {
content: [ javafx.scene.image.ImageView {
image: bind sfeerimage
}
]
};
}
}

Usage is very straight forward, just like ImageView, and I can toggle between the two by simply adding or removing "2" after "SfeerNode" in the main code.

The problem: the full package version does NOT show the image, the import version does.

Why?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tbee
Offline
Joined: 2003-07-23