import javax.swing.JOptionPane;
public class Example {
public static void main(String[] args) {
String colour = JOptionPane.showInputDialog("What's your favourite colour?");
int shade = Integer.parseInt(JOptionPane.showInputDialog("From a scale of 1-10, 10 being the darkest and 1 being the lightest, what shade do you like?"));
String response = "";
if (colour == "Red") {
if (shade < 5)
response = "Light Red";
else
response = "Dark Red";
JOptionPane.showMessageDialog(null, "Your colour is " + response);
}
}
}
Why doesn't the final JOptionPane message show up? For example, the user enters "Red" and then "1", the response isn't showing up as "Light Red".