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









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 display the email message in jsp
Javascript alert message
how to create alert message after data submitted into database
GETTING AN 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?
If statement doesn't work ,(doesn't print alert message when user dont field name and email)
difference between java5 and java6 - Java Beginners
selected radiobutton to display different page
. Display JavaScript dropdown selected value
Java2
Display alert box on clicking link
A MIDlet Example to execute Alert Message with an Image
how to display textbox value based on selected option value?
Getting content of alert message into textfield
Getting content of alert message into textfield
JavaScript display variable in alert
how to display the selected row from the data table in model panel ??
nested selected tag ihave display selected item
jcheckbox in jtable does nothing when clicking on it
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc
about java1
Display two alert box alternately by clicking on text
How to obtain the selected data item from a list box when listbox contains objects wrapped under Arraylist?
Javah
Display message on scroll Event
javaa swings - IDE Questions
Java Alert Box
how to insert the selected item of combobox in mysql - XML
autogeneration of a random number and displaying it as a alert message to the user on clicking submit
Name Display in alert box - JSP-Servlet
To Display the 'Last Modified' message in JSP
Display JSP selected listbox and checkbox in xml-please help me
Display message automatically using Java Swing
Display error message if data is already inserted in database
About Java2
Display Errors using Message Resources - Struts
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
navigation between panels when item is selected from jcombobox - Swing AWT
Create a JSpinner Component in Java
display error message for dupliacate record in properties file
when radio button is selected corresponding jsp page should open
to update drop down list value when selected from website
to update drop down list value when selected from website
to update drop down list value when selected from website

Ads