找不到符号符号:方法JOptionPane mutliple按钮

时间:2017-05-21 19:26:41

标签: java swing jbutton joptionpane cannot-find-symbol

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]);

    }

}

这是我正在制作的游戏的代码。但是,就行了

int action = JOptionPane.showOptionDialogue(null, .. 

我收到错误消息:

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

我对java比较陌生,只想创建一个基于快速文本的游戏,我将从另一种更简单的语言转移,所以我不知道这个错误意味着什么,或者如何修复它以便有任何帮助?

1 个答案:

答案 0 :(得分:2)

修复拼写。它是 showOptionDialog ,而不是showOptionDialogue