-
Bug
-
Resolution: Not an Issue
-
P2
-
None
-
8
-
None
-
jdk8.0 b89
To reproduce run attached code.
Click on some application to lose focus. And wait 3 seconds.
On Macos you won't get focused state(just like toFront method).
On Windows you will get focused property equals true, but application won't receive input from keyboard
public class Bug extends Application {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
// TODO code application logic here
}
@Override
public void start(Stage stage) throws Exception {
stage.setScene(new Scene(new HBox(new Button("One"),new Button("two")), 200, 200));
stage.show();
new Thread(() -> {
while (true) {
Platform.runLater(() -> {
stage.requestFocus();
});
try {
Thread.sleep(3000);
} catch (Exception ex) {
}
}
}).start();
new Thread(()->{while(true){
Platform.runLater(()->System.out.println("Focused"+stage.isFocused()));
Platform.runLater(()->System.out.println("Showing"+stage.isShowing()));
try{
Thread.sleep(2000);
}catch(Exception ex){
}
}}).start();
}
}
Click on some application to lose focus. And wait 3 seconds.
On Macos you won't get focused state(just like toFront method).
On Windows you will get focused property equals true, but application won't receive input from keyboard
public class Bug extends Application {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
// TODO code application logic here
}
@Override
public void start(Stage stage) throws Exception {
stage.setScene(new Scene(new HBox(new Button("One"),new Button("two")), 200, 200));
stage.show();
new Thread(() -> {
while (true) {
Platform.runLater(() -> {
stage.requestFocus();
});
try {
Thread.sleep(3000);
} catch (Exception ex) {
}
}
}).start();
new Thread(()->{while(true){
Platform.runLater(()->System.out.println("Focused"+stage.isFocused()));
Platform.runLater(()->System.out.println("Showing"+stage.isShowing()));
try{
Thread.sleep(2000);
}catch(Exception ex){
}
}}).start();
}
}