-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
fx1.0
-
JavaFX 1.0.1, emulator running on Windows XP, 6u10 b33
I've a node which has onKeyPressed defined. When the application comes up, I expect that node to have keyboard focus. But, the node does not have focus when run on emulator. This works fine on desktop.
To reproduce, run the below code on emulator. When the application comes up, press any key. If the rectangle does not rotate, bug is reproduced.
import javafx.scene.*;
import javafx.stage.*;
import javafx.scene.shape.*;
import javafx.scene.input.*;
import javafx.scene.paint.*;
import javafx.scene.text.*;
var rotate: Integer = 0;
var rect: Rectangle = Rectangle {
x: 10
y: 10
width: 60
height: 50
rotate: bind rotate
fill: Color.BLUE
onMouseClicked: function(e: MouseEvent) {
rect.requestFocus();
}
onKeyPressed: function(e: KeyEvent) {
rotate++;
}
};
Stage {
scene: Scene {
content: [rect, Text {
content: bind "Focused: {rect.focused}"
x: 10
y: 90
}]
}
width: 100
height: 150
}
To reproduce, run the below code on emulator. When the application comes up, press any key. If the rectangle does not rotate, bug is reproduced.
import javafx.scene.*;
import javafx.stage.*;
import javafx.scene.shape.*;
import javafx.scene.input.*;
import javafx.scene.paint.*;
import javafx.scene.text.*;
var rotate: Integer = 0;
var rect: Rectangle = Rectangle {
x: 10
y: 10
width: 60
height: 50
rotate: bind rotate
fill: Color.BLUE
onMouseClicked: function(e: MouseEvent) {
rect.requestFocus();
}
onKeyPressed: function(e: KeyEvent) {
rotate++;
}
};
Stage {
scene: Scene {
content: [rect, Text {
content: bind "Focused: {rect.focused}"
x: 10
y: 90
}]
}
width: 100
height: 150
}