I want an user to enter a word ...this program will tell the person if it is a palindrome...how do i insert joption pane code into this:

public boolean isPalindrome(int start int end)
{
   //separate case for substrings of length 0 or 1
   if (start>=end) return true;

   //get first and last character, converted to lowercase
   char first = Character.toLowerCase(text.charAt(start));
   char last = Character.toLowerCase(text.charAt(end));

   if ((Character.isLetter(first) && Character.isLetter(last))
   {
      if (first == last)
      {
         //test substring that doesn't contain the matching letters
         return isPalindrome(start +1, end -1);
      }
      else
         return false;
   }
   else if (!Character.isLetter(last))
   {
      //test substring that doesn't contain last character
      return isPalindrome(start, end -1);
   }
   else
   {
      //test substring that doesn't contain first character
      return isPalindrome(start + 1, end);
}
JOptionPane.showMessageDialog(null, "Your message goes here");
Be a part of the DaniWeb community

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