How to Display an alert message when nothing is selected in jspinner in java?

Ads
 

How to Display an alert message when nothing is selected in jspinner in java?

Hello,

i'm trying to code a jspinner in java and i want to display a message when nothing is selected. My initial value is 0 min value = 0 max value = 200

so when the application is running it displays the jspinner with the initial value = 0 what i want is if the user did not select the jspinner an alert message should appears. here is what i tried without success.

public int getAlerte() { int x = 0;

    if (Integer.parseInt(jSpinnerParameter.getValue().toString()) <= 0 ||
    Integer.parseInt(jSpinnerParameter.getValue().toString()) >200){
    JOptionPane.showMessageDialog(this, "Color Number should be 1 minimum",
            "Alert", JOptionPane.ERROR_MESSAGE);
    x = 1;
}       

     return x;

}

the Alert message is never displayed,please i need help. Thank you

View Answers

Ads









Related Tutorials/Questions & Answers:
How to Display an alert message when nothing is selected in jspinner in java?
GETTING ALERT MESSAGE
Advertisements
code to alert when no checkbox is selected and verify them with orther set
how to display selected checkboxes dynamically using jsp
how to create alert message after data submitted into database
how to enable textfield in j2me netbeans when a choice element is selected?
how to enable textfield in j2me netbeans when a choice element is selected?
Javascript alert message
GETTING AN ALERT MESSAGE
If statement doesn't work ,(doesn't print alert message when user dont field name and email)
selected radiobutton to display different page
how to display textbox value based on selected option value?
. Display JavaScript dropdown selected value
how to display the selected row from the data table in model panel ??
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc
JavaScript display variable in alert
Java2
Getting content of alert message into textfield
Getting content of alert message into textfield
nested selected tag ihave display selected item
jcheckbox in jtable does nothing when clicking on it
How to obtain the selected data item from a list box when listbox contains objects wrapped under Arraylist?
Javah
Java Alert Box
To Display the 'Last Modified' message in JSP
autogeneration of a random number and displaying it as a alert message to the user on clicking submit
how to display?
how to display?
how to display?
Javascript get Date And Selected Option Text
Display error message if data is already inserted in database

Ads