摘要:
Normally, a keystroke registered to a component is activated when the component has the focus. This type of activation condition is called WHEN_FOCUSE 阅读全文
摘要:
The opposite component is the other component affected in a focus event. Specifically, in a focus-lost event, the opposite component is the one gainin 阅读全文
摘要:
A temporary focus-lost event occurs if the focus moves to another window. It's temporary because the component will gain the focus when its window bec 阅读全文
摘要:
JFrame frame = new JFrame(); JButton component1 = new JButton("1"); JButton component2 = new JButton("2"); JButton component3 = new JButton("3"); // By default, the focus travers... 阅读全文
摘要:
There is no straightforward way to set the initial focused component in a window. The typical method is to add a window listener to listen for the win 阅读全文
摘要:
This example changes the focus traversal keys for the entire application. For an example of how to change the focus traversal keys for a particular co 阅读全文
摘要:
When the focus is on a component, any focus traversal keys set for that component override the default focus traversal keys. For an example of how to 阅读全文
摘要:
The methods to move the focus to the next or to the previous focusable component are Component.transferFocus() and Component.transferFocusBackward(). 阅读全文
摘要:
To listen to focus change events between components, install a listener with the keyboard focus manager. If you need the ability to veto (reject) a fo 阅读全文
摘要:
// null is returned if none of the components in this application has the focus Component compFocusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); ... 阅读全文
摘要:
public Component findNextFocus() { // Find focus owner Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); Container root = c == null ? null : ... 阅读全文
摘要:
There are two ways to fill basic shapes like lines and rectangles. The first is to use specific drawing methods like Graphics.fillOval(). This example 阅读全文
摘要:
Normally, a keystroke registered on a component is activated when the component has the focus. This type of activation condition is called WHEN_FOCUSE 阅读全文
摘要:
There are two ways to draw basic shapes like circles, ovals, lines, arcs, squares, rectangles, rounded rectangles, and polygons. The first is to use s 阅读全文
摘要:
See also e575 The Quintessential Drawing Program and e594 Reading an Image or Icon from a File. 阅读全文
摘要:
See also e575 The Quintessential Drawing Program. 阅读全文
摘要:
Registering a key event dispatcher with the keyboard focus manager allows you to see all key events before they are sent to the focused component. It 阅读全文