Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8106046

Mobile: The sole focusable node do not have keyboard focus

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • fx1.0
    • javafx
    • 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
      }

            ailjin Artem Iljin (Inactive)
            gramachasunw Girish Ramachandran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: