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);           
    for (int i = 0; i < tab.length; i++) {
        Parameter param = new Parameter("TYPE", i, tab[i]);
        double percent = DMath.round((double)100 / tab.length, 2);
        parametersTable.addToPercent(param, percent );
        ObjectRenderer or = new ObjectRenderer();
        or.add("%", percent);

Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.