Is it possible to modify a file path so that it incorporates a String variable?
example code
String var = "Picture.jpg";
ImageIcon img = new ImageIcon("C:\\Users\\Main\\Documents\\CompSciProjects\\Memory Game\\var");
Use String.format
String var = "Picture.jpg";
ImageIcon img = new ImageIcon(String.format("C:\\Users\\Main\\Documents\\CompSciProjects\\Memory Game\\%s", var));
ImageIcon img = new ImageIcon("C:\\Users\\Main\\Documents\\CompSciProjects\\Memory Game\\" + var);