Neversleepin 0 Junior Poster in Training

Hi everyone,

i want to set input verifier for a jspinner when the user click a value and if the value is out of range (0 to 10) it must display a message like "Please enter a value between 0 to 10" and it must validate until the correct value is entered.
I tried to add this line, it's working but it's not getting the input value from the warning message
so i'm trying other solutions
//String nbrPar = JOptionPane.showInputDialog(null, "Enter col number","S def",JOptionPane.WARNING_MESSAGE);

here is the code for jspinner:

 private void jSpinnerParStateChanged(javax.swing.event.ChangeEvent evt) {                                               

    nbrPar = (Integer)jSpinnerPar.getValue();         
         if (nbrPar <=1){             
        //String nbrPar = JOptionPane.showInputDialog(null, "Enter col number","S def",JOptionPane.WARNING_MESSAGE);

        }
    java.awt.Color tab[] = ImageTools.getColorsRGB(nbrPar);           
    rc.reset();
    parametersTable.reset();
    for (int i = 0; i < tab.length; i++) {
        Parameter param = new Parameter("TYPE", i, tab[i]);
        param.setName("TYPE");
        parametersTable.addParameter(param);
        double percent = DMath.round((double)100 / tab.length, 2);
        parametersTable.addToPercent(param, percent );
        ObjectRenderer or = new ObjectRenderer();
        or.addParameter(param);
        or.add("%", percent);
        rc.add(or);
    }
    this.validate();
    }

Thank you