I need help finishing up my program. I mainly need help in the sort, search, and delete methods. Any other help would be great as well. (Direct Code will be greatly accepted)
public class Lab8 extends Applet implements ActionListener { final int MAXRECIPES = 100; private ArrayList recipes = new ArrayList(); String name; //= new String(); String time; //= new String(); String calories; //= new String(); String ing; //= new String(); String inst; //= new String(); String cat; //= new String(); //String nameArray[] = new String[MAXRECIPES]; //String timeArray[] = new String[MAXRECIPES]; //String calArray[] = new String[MAXRECIPES]; //String catArray[] = new String[MAXRECIPES]; //String ingArray[] = new String[MAXRECIPES]; //String instArray[] = new String[MAXRECIPES]; String sent; private boolean itemSelected = false; private int indexSelected = -1; private CookBook[] recipe = new CookBook[MAXRECIPES]; CookBook[] temp; Label title = new Label("Java Cookbook"); Button submit = new Button("Submit"); Button clear = new Button("Clear"); Button sort = new Button("Sort"); Button delete = new Button("Delete"); Button search = new Button("Search"); Button display = new Button("Display"); Label rnlabel = new Label("Recipe Name"); TextField recName = new TextField(30); Label ptlabel = new Label("Preperation Time (Minutes)"); TextField prepTime = new TextField(5); Label nclabel = new Label("Calories"); TextField numCal = new TextField(7); Label catLabel = new Label("Category"); Choice category = new Choice(); Label ingLabel = new Label("Ingredients"); TextArea ingredients = new TextArea(15,20); Label instLabel = new Label("Instructions"); TextArea instructions = new TextArea(15,20); Label sllabel = new Label("Search By:"); Choice searchList = new Choice(); Label selabel = new Label("Search For:"); TextField searchEnt = new TextField(30); Label dispLabel = new Label("Results"); TextArea displayArea = new TextArea("",15,30); Label deletelabel = new Label("Name of Recipe to Delete"); TextField delField = new TextField(20);
Panel displayPanel = new Panel(new GridLayout(2,1)); Panel p1 = new Panel(), p2 = new Panel(), p3 = new Panel(), p4 = new Panel(), p5 = new Panel(), p6 = new Panel(), p7 = new Panel(), p8 = new Panel(), p9 = new Panel(), p10 = new Panel(), p11 = new Panel(), p12 = new Panel(), p13 = new Panel(), p14 = new Panel();