Java code written while learning Swing.