-2
package thearena;

import javax.swing.JOptionPane;
import java.util.Random;

public class Arena {

    public static void main(String[] args) {

        Object[] loading_choices = {"Yes","No"};
        int action = JOptionPane.showOptionDialogue(null,
            "Welcome to The Arena, a text based game featuring turn based combat.",
            "The Arena",
            JOptionPane.DEFAULT_OPTION, 
            JOptionPane.QUESTION_MESSAGE, 
            null, 
            loading_choices, 
            loading_choices[0]);
        System.out.println("The user picked: " + loading_choices[action]);

    }

}

That is my code for a game I am making. However, on the line

int action = JOptionPane.showOptionDialogue(null, .. 

I get an error that says:

Cannot find symbol
symbol: method
showOptionDialogue(<null>,String,String,int,int,<null>,Object[],Object)
location: class JOptionPane

I am relatively new to java and just wanted to make a quick text based game that I am transferring over from another simpler language so I do not know what this error means or how to fix it so any help?

Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
PHDBanana
  • 7
  • 5

1 Answers1

2

Fix the spelling. It's showOptionDialog, not showOptionDialogue.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
dumbPotato21
  • 5,669
  • 5
  • 21
  • 34
  • Thanks, maybe copy and pasting other peoples code isn't the right thing to do XD – PHDBanana May 21 '17 at 19:31
  • 1
    You might want to add that A) using an IDE prevents such problems and B) reading that javadoc helps too. And just for the record: I hope you notice that I am not at all recentful. Even if something happened that would ask for revenge. Which did not. – GhostCat May 21 '17 at 19:31
  • @GhostCat you're surely not recentful :). Actually, its greedy of me, to answer a typo question. I wouldn't have, but alas, Greed. – dumbPotato21 May 21 '17 at 19:36
  • 1
    Dont you worry. That drives most people. But I will still put in a "close as typo here"; so don't be too surprised when more downvotes for the question come in, and the question gets maybe deleted at some point ;-| But as said, there is some potential to make your good answer a really nice one. And that is something I strive for: when answering not so great question, make sure your answer is extraordinary. – GhostCat May 21 '17 at 19:38