What is my mistake? [closed]

-3

I'm starting to use the netbeans and java environment. I do not understand what is wrong with the method that I use or that does not become whole. I'd appreciate your help.

    
asked by Raul Alberto Urtecho Magaña 24.02.2017 в 03:05
source

2 answers

3

It is not good to use static variables if they are not going to be something like

public static final double PI = 3.14159265;

The problem is that the error is not the conversion, but the method parameter .showMessageDialog ()

 JOptionPane.showMessageDialog(null,"aaaaaaaa"+a,"bbbbbb"+b);//elimina las comas despues del null remplazalas por +
 JOptionPane.showMessageDialog(null,"aaaaaaaa"+a+"bbbbbb"+b);
    
answered by 24.02.2017 / 03:34
source
1

The error is that you put a String as an argument, being that the type of parameter is int and in addition it is own of Component JOptionPane .

JOptionPane.showConfirmDialog(null, new Object[]{"Parrafo 1", "Parrafo 2", "Parrafo 3"}, "Titulo",JOptionPane.DEFAULT_OPTION);

//Tipos
JOptionPane.DEFAULT_OPTION //Un simple "Aceptar"
JOptionPane.CANCEL_OPTION  //Botón de "Aceptar" y "Cancelar"

Here you have all the parameters of the component.

    
answered by 24.02.2017 в 03:25