This is a list of links to some of my answers on Stack Overflow that contain small, yet complete runnable Swing apps. Most of the answers have images (or GIFs) so you can see what the app does. You should be able to just copy/paste/run the code.
Enjoy and please feel free to contact me with any questions. But note that I no longer use Swing, and have not used it in a while. So I may not be able to answer some questions regarding the code.
paulsamsotha.dev at gmail dot com
I will try to update this list once in a while when I get a chance. If you would like to go through all my answers in the Swing tag, here is the link.
https://stackoverflow.com/search?q=user:2587435+[swing]
-
Java swing repainting while computing: animating sorting algorithm
-
How to use CardLayout with Netbeans GUI Builder. This is not a complete app, but is a tutorial on how
-
How to get focus on jmenu so that i can use keyboard to operate
-
How can I add a login screen to an existing Java Swing program?
-
JTextField, using Document Filter to filter integers and periods
-
How can you validate the first column of a JTable with regex?
-
How do I make a rectangle move across the screen with key bindings?
-
Draw varying size rectangle with different orientation using rectangle 2D
-
Rendering jtable cell foreground based on positive or negative values
-
How do I change the size of a rectangle while painting a histogram?
-
How to change background color of jDesktopPane which is created usning tools in netbeans
-
What is best way to center objects in JPanel horizontally and vertically