1. inputEvent方法(判断鼠标右键和鼠标中间键是否被点击)
InputEvent methods that help determine whether the right or center mouse button was clicked | |
InputEvent method | Description |
isMetaDown() | Returns true when the user clicks the right mouse button on a mouse with two or three buttons. To simulate a right-mousebutton click on a one-button mouse, the user can hold down the Meta key on the keyboard and click the mouse button. |
isAltDown() | Returns true when the user clicks the middle mouse button on a mouse with three buttons. To simulate a middle-mouse-button click on a one- or two-button mouse, the user can press the Alt key and click the only or left mouse button, respectively. |
2. 简单画图板的实现
3. 键盘事件捕捉演示
4. 页面布局管理器
5. FlowLayout示例
6. BorderLayout示例
7. GridLayout示例
8. JPanel示例