[C++ or Other Android Development Languages] jflow36:
Hello all! I am currently in the last few weeks of Intro to Java 8 and my last project is this:

18.14 (Palindromes) A palindrome is a string that is spelled the same way forward and backward. Some examples of palindromes are “radar,” “able was i ere i saw elba” and (if spaces are ignored) “a man a plan a canal panama.” Write a recursive method testPalindrome that returns boolean value true if the string stored in the array is a palindrome and false otherwise . The method should ignore spaces and punctuation in the string.

The program has to be written in Java, because its for a Java 8 Intro class :) I actually finished the program and compiled it with no problem... But when I run it, I get this:

Error: Main method not found in class Palindrome, please define the main method as:

public static void main(String[] args)

or a JavaFX application class must extend javafx.application.Application

I just can't figure out what I did wrong! I've been going over the code for days and I'm pretty sure this particular app doesn't need a main method for functionality... Any suggestions would be greatly appreciated!!!

Here's my code:

// Palindrome.java

import java.awt.event.*;

import java.awt.*;

import javax.swing.*;

// Palindrome class

public class Palindrome extends JApplet implements ActionListener

{

JLabel prompt;

JTextField input;

// set up GUI

public void init()

{

prompt = new JLabel("Enter a string:");

input = new JTextField(20);

input.addActionListener(this);

Container container = getContentPane();

container.setLayout(new FlowLayout());

container.add(prompt);

container.add(input);

} // end init method

// actionPerformed method

public void actionPerformed(ActionEvent actionEvent)

{

String string = actionEvent.getActionCommand();

char[] copy = new char[string.length() + 1];

int counter = 0;

// loop through the string

for (int index = 0; index < string.length(); index++)

{

// uses charAt method to return character

// at the specified subscript

char character = string.charAt(index);

copy[counter++] = character;

} //end loop

// calls testPalindrome method, if it

// is it displays "Palindrome". If its

// not it displays "Not a palindrome".

if (testPalindrome(copy, 0, counter - 1) == 1)

showStatus("Palindrome");

else

showStatus("Not a palindrome");

} // end actionParformed method

// testPalindrome method, recursively test

// if the array is a palindrome

public int testPalindrome(char array[], int left, int right)

{

while (array

== ' ' || array

== '.' ||

array

== ';' || array

== ':' ||

array

== '?' || array

== '!' ||

array

== '-' || array

== ',')

left++;

while (array

== ' ' || array

== '.' ||

array

== ';' || array

== ':' ||

array

== '?' || array

== '!' ||

array

== '-' || array

== ',')

right--;

if (left == right || left > right)

return 1;

else if (array

!= array

)

return 0;

else

return testPalindrome(array, left + 1, right - 1);

} // end testPalindrome method

} // end Palindrome class

For some reason when I submit this it gets rid of all the formatting and spacing... For that reason, I will attach my file so if you're interested in helping, it'll be much easier to download the java file and see it how it is originally... I really appreciate the help. This program should work. I've tried several ways of changing things around and I just can't get it to work. Please help? I know that I'm probably gonna feel like an idiot when someone finally tells me what I'm missing!!!​