I created a program to display information about the presidentsin Java. When I click the start button, it starts to move, but whenI stop and click the start button again, it advance two pages at atime. It has to change one page at a time. Please correct thiserror.
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Timer;
// Defines a class Map2 derived from JFrame
public class Map2extends JFrame {
// Declares a JPanel object
JPanel panel;
// Declares a JLabel object
JLabel label;
// Declares a Timer object
Timer tm;
// Variable to toggle font style
int x = 1;
// Creates a font style
String pre1 = “<html> “
+ “<font
PayPal Gateway not configured
PayPal Gateway not configured