![How to Write a Mouse Listener (The Java™ Tutorials > Creating a GUI With Swing > Writing Event Listeners) How to Write a Mouse Listener (The Java™ Tutorials > Creating a GUI With Swing > Writing Event Listeners)](https://docs.oracle.com/javase/tutorial/figures/uiswing/events/MouseEventDemo.png)
How to Write a Mouse Listener (The Java™ Tutorials > Creating a GUI With Swing > Writing Event Listeners)
![Creating the Demo Application (Step 3) (The Java™ Tutorials > Creating a GUI With Swing > Performing Custom Painting) Creating the Demo Application (Step 3) (The Java™ Tutorials > Creating a GUI With Swing > Performing Custom Painting)](https://docs.oracle.com/javase/tutorial/figures/uiswing/painting/swing3.png)
Creating the Demo Application (Step 3) (The Java™ Tutorials > Creating a GUI With Swing > Performing Custom Painting)
![How to Write a Mouse-Motion Listener (The Java™ Tutorials > Creating a GUI With Swing > Writing Event Listeners) How to Write a Mouse-Motion Listener (The Java™ Tutorials > Creating a GUI With Swing > Writing Event Listeners)](https://docs.oracle.com/javase/tutorial/figures/uiswing/events/MouseMotionEventDemo.png)
How to Write a Mouse-Motion Listener (The Java™ Tutorials > Creating a GUI With Swing > Writing Event Listeners)
![Java Swing adding mouse Listener (inner class) for an array of buttons leads to malfunction - Stack Overflow Java Swing adding mouse Listener (inner class) for an array of buttons leads to malfunction - Stack Overflow](https://i.stack.imgur.com/jwRs1.png)
Java Swing adding mouse Listener (inner class) for an array of buttons leads to malfunction - Stack Overflow
![How to Write a Mouse Listener (The Java™ Tutorials > Creating a GUI with JFC/Swing > Writing Event Listeners) How to Write a Mouse Listener (The Java™ Tutorials > Creating a GUI with JFC/Swing > Writing Event Listeners)](https://www.cs.auckland.ac.nz/references/java/java1.5/tutorial/figures/uiswing/events/MouseEventDemo.png)