Discussion:
Q: Writing a Java GUI displaying time when button clicked
Enhance the ButtonViewer program so that it prints the time at which the button was clicked.
Use the following class as your main class:
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;