You shouldn't have two variables with the same name.
The variable year inside the while loop, if it even allows it to be valid at all, which I'm not sure about, as it has the same name as the String variable year, goes out of scope once the loop ends anyway and so you're comparing Strings and integers.
Actually, on a second inspection, you've assigned a String variable an int value. That'll cause an error.
Usually you should initialize variables like film and textinput1 before going into the loop.
Are you trying to show a dialog box?
JOptionPane.showMessageDialog(null, "The earliest film was");
Are you trying to show some error message to report if the movie year isn't possible? (Also try also having a block to check to see if it's like before 1900 as they didn't have anything except maybe, and a very small maybe, slides or something, back then.)
JOptionPane.showMessageDialog(null, "Year " + year + " hasn't even happened yet!!!!!", "Invalid year", JOptionPane.ERROR_MESSAGE);
Are you trying to figure out a plain message box?
JOptionPane.showMessageDialog(null, "The earliest film was");
You are kind of vague on the error but I'm thinking it's related to the two variables with the same name.