-
Bug
-
Resolution: Duplicate
-
P4
-
8u20
-
Windows 7 Pro SP1 x64, JDK 1.8.0_20-ea-b05
Code to reproduce the issue:
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
public class Test7 extends Application
{
public static void main(final String[] args)
{
launch(args);
}
@Override
public void start(final Stage primaryStage) throws Exception
{
final TextField field = new TextField();
field.setPrefColumnCount(30);
field.setEditable(true);
field.focusedProperty().addListener(new ChangeListener<Boolean>()
{
@Override
public void changed(final ObservableValue<? extends Boolean> observable, final Boolean oldValue, final Boolean newValue)
{
System.out.println("focus: " + newValue);
}
});
primaryStage.setScene(new Scene(field));
primaryStage.show();
field.requestFocus();
}
}
There's a focused text field in a window. Minimizing the window using its "_" button causes the text field to lose its focus (see "focus: false" in console). Restoring the window makes the text field being focused again (see "focus: true" in console).
Minimizing the window by clicking its icon on the Windows taskbar makes the field lose and instantly regain its focus (the output is "focus: false focus: true").
This is related to RT-36089 andDTL-6679 as these are tickets describing invalid behavior of popup windows depending on correct focus behavior.
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
public class Test7 extends Application
{
public static void main(final String[] args)
{
launch(args);
}
@Override
public void start(final Stage primaryStage) throws Exception
{
final TextField field = new TextField();
field.setPrefColumnCount(30);
field.setEditable(true);
field.focusedProperty().addListener(new ChangeListener<Boolean>()
{
@Override
public void changed(final ObservableValue<? extends Boolean> observable, final Boolean oldValue, final Boolean newValue)
{
System.out.println("focus: " + newValue);
}
});
primaryStage.setScene(new Scene(field));
primaryStage.show();
field.requestFocus();
}
}
There's a focused text field in a window. Minimizing the window using its "_" button causes the text field to lose its focus (see "focus: false" in console). Restoring the window makes the text field being focused again (see "focus: true" in console).
Minimizing the window by clicking its icon on the Windows taskbar makes the field lose and instantly regain its focus (the output is "focus: false focus: true").
This is related to RT-36089 and
- duplicates
-
JDK-8095048 Win: Window does not repaint after application collapse/expand via click icon on taskbar
- Resolved
- relates to
-
JDK-8087573 [Glass, win32] Controls get refocused on window restore before they know their position (wrong Node.localToScreen(Point2D) behavior)
- Open