Month: September 2008

Simple Mouse Tracker GUI using Java Swing

This Java source code defines a simple mouse tracking program using Swing which is a graphical user interface toolkit. The program displays a window with a drawing surface that captures and visualizes various mouse events. The mouse’s current coordinates, modifier keys (Shift, Control, Meta, and Alt), and the type of the most recent mouse event are displayed in real-time on the window.

Read More

Interactive Java Stopwatch Component

The StopWatch class introduces a versatile stopwatch component with enhanced functionality in Java. Extending JLabel and implementing the MouseListener interface, this interactive component not only measures elapsed time but also dynamically updates to display the current time in the format “Hours:Minutes:Seconds:Milliseconds”.

Read More

Towers of Hanoi Java Program

This Java Program solves the Towers of Hanoi problem for a tower of 10 disks. Ten differently-sized disks are stacked in a pile, in order of decreasing size. There are two other places for piles. The object is to move the pile to the second available place, subject to the rules that only one disk at a time can be moved, and no disk can be piled on top of a smaller disk. The Towers of Hanoi problem is a standard example of recursion.

Read More
Mothers Day Gift Ideas