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

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
Javascript alert message
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?
how to create alert message after data submitted into database
If statement doesn't work ,(doesn't print alert message when user dont field name and email)
GETTING AN ALERT MESSAGE
selected radiobutton to display different page
. Display JavaScript dropdown selected value
how to display textbox value based on selected option value?
JavaScript display variable in alert
Java2
A MIDlet Example to execute Alert Message with an Image
Getting content of alert message into textfield
Getting content of alert message into textfield
how to display the selected row from the data table in model panel ??
nested selected tag ihave display selected item
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc
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
Display error message if data is already inserted in database
Dynamically display values in dropdown box and then show the selected values as selected by the user which is already stored in the DB
depending on the form name i have to display the message
Javascript get Date And Selected Option Text

Ads