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