É que estou começando no mundo java não faz muito tempo, e logo as dúvidas começam a fluir, rsrs.
Bom pessoal, algum sabe me dizer o que está ocorrendo de errado dentro desde código ?
int opcao;
opcao = JOptionPane.showConfirmDialog(“null”, “Deseja mesmo encerrar aplicação ?”,
“Fechar”, JOptionPane.YES_NO_OPTION);
Para vc que está iniciando, tenha sempre “a mão” a API do Java, ela vai lhe ser muito útil!
Por ex, veja o que a API do Java fala sobre o showConfirmDialog:
static int showConfirmDialog(Component parentComponent, Object message)
static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType)
static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)
static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon)
Tem esses 4 possíveis usos, e por acaso, a forma como vc está tentando usar não bate com nenhuma dessas 4 situações!
Tente assim:
int opcao;
opcao = JOptionPane.showConfirmDialog(null, "Deseja mesmo encerrar aplicação ?", "Fechar", JOptionPane.YES_NO_OPTION);
DICA: Sempre coloque o fonte dentro da tag code.