-
Bug
-
Resolution: Fixed
-
P3
-
8u20
-
b54
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8083989 | emb-9 | Anton Nashatyrev | P3 | Resolved | Fixed | team |
JDK-8086803 | 8u65 | Anton Nashatyrev | P3 | Resolved | Fixed | b01 |
JDK-8073348 | 8u60 | Anton Nashatyrev | P3 | Resolved | Fixed | b06 |
JDK-8138020 | emb-8u65 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8076880 | emb-8u60 | Anton Nashatyrev | P3 | Resolved | Fixed | team |
toolkit.getScreenInsets() is used by clients in conjunction with screen
bounds to position components on screen so they do not overlap the dock or
task bar.
However, if the dock location changes when the component is up, the insets
retrieved by this call do not reflect the new reality.
Test case:
Run the following code. Press the button that appears on screen and note the
insets.
With the app still running, change the dock position in the OS
Press the button again. The insets do not reflect the location of the dock.
Restart app, the insets are now updated.
import java.awt.Toolkit;
import javax.swing.JButton;
import javax.swing.JFrame;
public class DockUpdate {
public static void main(String[] args) {
JButton button = new JButton();
button.addActionListener((evt) ->
System.out.println(Toolkit.getDefaultToolkit().getScreenInsets(
button.getGraphicsConfiguration())));
JFrame frame = new JFrame();
frame.add(button);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(50, 50);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
bounds to position components on screen so they do not overlap the dock or
task bar.
However, if the dock location changes when the component is up, the insets
retrieved by this call do not reflect the new reality.
Test case:
Run the following code. Press the button that appears on screen and note the
insets.
With the app still running, change the dock position in the OS
Press the button again. The insets do not reflect the location of the dock.
Restart app, the insets are now updated.
import java.awt.Toolkit;
import javax.swing.JButton;
import javax.swing.JFrame;
public class DockUpdate {
public static void main(String[] args) {
JButton button = new JButton();
button.addActionListener((evt) ->
System.out.println(Toolkit.getDefaultToolkit().getScreenInsets(
button.getGraphicsConfiguration())));
JFrame frame = new JFrame();
frame.add(button);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(50, 50);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
- backported by
-
JDK-8073348 Toolkit.getScreenInsets() doesn't update if insets change
-
- Resolved
-
-
JDK-8076880 Toolkit.getScreenInsets() doesn't update if insets change
-
- Resolved
-
-
JDK-8083989 Toolkit.getScreenInsets() doesn't update if insets change
-
- Resolved
-
-
JDK-8086803 Toolkit.getScreenInsets() doesn't update if insets change
-
- Resolved
-
-
JDK-8138020 Toolkit.getScreenInsets() doesn't update if insets change
-
- Resolved
-