📄 e865. converting between component and screen coordinates.txt
字号:
This example demonstrates how to convert a coordinate within a component to a coordinate on the screen and visa versa.
// Convert a coordinate relative to a component's bounds to screen coordinates
Point pt = new Point(component.getLocation());
SwingUtilities.convertPointToScreen(pt, component);
// Convert a coordinate on a screen to a coordinate relative to a component's bounds
SwingUtilities.convertPointFromScreen(pt, component);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -