-
Bug
-
Resolution: Fixed
-
P2
-
fx1.2
If you wrap a SwingComponent with a CustomNode and then change the size of the SwingComponent the bounds detection doesn't work correctly. All mouse events including rollover, click, etc. only work in the area the SwingComponent occupied prior to resize. In the case of certain components, such as SwingLists, this makes them inoperable. Also, there is no equivalent control for a list yet, which makes a workaround difficult.
Here is a code sample:
var list = SwingList {
items: for (i in [0..200]) SwingListItem {
text: "{i}"
}
}
class CustomNodeWrapper extends CustomNode {
override function create() {
list
}
}
Stage {
scene: Scene {
width: 500
height: 500
content: CustomNodeWrapper {}
}
}
list.width = 500;
list.height = 500;
It will display a 500x500 pixel list, but if you try to use the scrollbar, none of the mouse events will register.
A working example is attached. This applies to all SwingComponents (uncomment the SwingButton line to try that instead).
Here is a code sample:
var list = SwingList {
items: for (i in [0..200]) SwingListItem {
text: "{i}"
}
}
class CustomNodeWrapper extends CustomNode {
override function create() {
list
}
}
Stage {
scene: Scene {
width: 500
height: 500
content: CustomNodeWrapper {}
}
}
list.width = 500;
list.height = 500;
It will display a 500x500 pixel list, but if you try to use the scrollbar, none of the mouse events will register.
A working example is attached. This applies to all SwingComponents (uncomment the SwingButton line to try that instead).