Code:
import java.awt.*;
import javax.swing.*;
import java.util.*;

/**
 * Write a description of class Game here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Game
{
    private String sideChoice;
    private String nameChoice;
    private String nameOfVillan;
    private String nameOfHero;
    
    public Game()
    {
    }
    public void run()
    {
        System.out.println("Do you want to use your own names? (y/n)");
        nameChoice = (String) JOptionPane.showInputDialog("Enter y or n");
        if(nameChoice == "y")
        {
            System.out.println("Please put the name of the hero. \n");
            nameOfHero = (String) JOptionPane.showInputDialog("Enter the name of the hero");
            System.out.println("Please put the name of the villan. \n");;
            nameOfVillan = (String) JOptionPane.showInputDialog("Input the name of the villan");
        }
        else if(nameChoice=="n")
        {
            nameOfHero = "Jeff";
            nameOfVillan = "Markum";
        }
        else
        {
            System.out.println("Please choose either y or n.");
            System.out.println("Stupid idiot java not getting the value of " + nameChoice + " nameChoice.");
        }
This returns:
Please choose either y or n.
Stupid idiot java not getting the value of n nameChoice.
Could you please tell me what I did wrong? It seems to be getting the value of nameChoice (it gave it to me in the println), but niether the if or the else if are executing, even when the variable is supposed to prove it true.