When I invoke the forward or backward method the current_numberisnt being changed. Not sure if its something in my switch case ormy methods..
package project4;
import java.awt.image.BufferedImage;
import java.net.URL;
import java.util.Scanner;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class PictureViewer {
final static int MIN_NUMBER = 0;
final static int MAX_NUMBER = 8;
static int image_number = 1;
public static int forward(int current_number) {
if (current_number < MAX_NUMBER) {
return current_number ++;
} else if (current_number > MAX_NUMBER) {
return MIN_NUMBER;
}
return current_number;
}
public static int backward(int current_number) {
if (current_number > MIN_NUMBER) {
return current_number–;
} else if (current_number <= MIN_NUMBER) {
return MIN_NUMBER;
}
return current_number;
}
public static String createFileName(int current_number) {
String imageString = “picture” + current_number + “.jpg”;
return imageString;
}
public static