I have a little problem with my first JOptionPane program. I don't get my if-statements to output anything. What did I do wrong?
package test1;
import javax.swing.JOptionPane;
public class Lol1 {
public void test() {
String res;
res = JOptionPane.showInputDialog("Does this work?");
if (res == "Yes") {
JOptionPane.showMessageDialog(null, "Good.");
}
if (res == "No") {
JOptionPane.showMessageDialog(null, "You're lying.");
}
}
public static void main(String[] args) {
Lol1 l1 = new Lol1();
l1.test();
}
}