No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I noticed a few things about my results from my codes. If I don't key in anything,no matter what I press(the ok,cancel or the x button) It will print out Please enter an integer value cannot be 0 or negative and contiune to prompt me until the I key in … |
|
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JFrame; import javax.swing.SwingUtilities; import javax.swing.Timer; @SuppressWarnings("serial") public class OnClickLesson extends JFrame { private int value = 0, clicked = 0, countdown = 1; private Timer timer = new Timer(1000, null); public OnClickLesson() { timer = new Timer(1000, new countDownTimer()); addMouseListener(new MouseAdapter() … |