import javax.swing.*; 		// Needed for swing classes
   	import java.awt.event.*;   // Needed for the action listener
   import java.io.*; 			// Needed for the file and IOException
   import java.util.Scanner;	// Needed for the scanner class
   import java.util.List;  	// Needed for the arraylist
   import java.util.Arrays;  	// Needed for the arraylict class
	
	/**
		This program creates a grade calculator that lets you enter
		multiple students name and three grades of each student.  When 
		calculate button is clicked, the results are displayed in 
		displayed in either alphabetical or numerical.
	*/
	
	
   public class GradeProgram extends JFrame
   {	
      private JPanel panel; 			// To reference the a  panel
      private JButton saveB, nextB, prevB, calcGrade;	// Creates the Buttons
		private JPanel buttonPanel; 	// To  reference the panel where all the buttons go
      private final int WINDOW_WIDTH = 350;
      private final int WINDOW_HEIGHT = 450;
   
   	/**
   		Constructor
   	*/
   	   	
      public GradeProgram()
      {               
      // Set the window title.
         setTitle("Grade Program");
      
      // Set the size of window.
         setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
      
      // Specify what happens when the close button is clicked.
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      	
      // Build the panel and add it to the frame.
			buildButtonPanel();

      
      // Add the panel to the frame's content pane.
         add(panel);


			
		// packs all the panels togather
         pack();
      
      // Display the window.
         setVisible(true);
      }
   	
   	/** 
   		The builds the buttons for the panel.
   	*/
   	
      private void buildButtonPanel()
      {
         prevB = new JButton("Prev");// Adds the text prev to the prevB
         calcGrade = new JButton("Calculate");// Adds the text Calc Grade to the calcGrade
         nextB = new JButton("Next");// Adds the text Next to the nextB
         saveB = new JButton("Save");// Adds the text Save to the saveB
       
         calcGrade.addActionListener(new calcGradeListener());// Adds an  ActionListener to the button
         prevB.addActionListener(new prevBListener());// Adds an  ActionListener to the button
         nextB.addActionListener(new nextBListener());// Adds an  ActionListener to the button
         saveB.addActionListener(new saveBListener());// Adds an  ActionListener to the button      
      	
			panel = new JPanel(); 
         buttonPanel.add(prevB);    // Adds the prevB to the panel
         buttonPanel.add(saveB);    // Adds the saveB to the panel
         buttonPanel.add(nextB);    // Adds the nextB to the panel
         buttonPanel.add(calcGrade);// Adds the calcGrade to the panel
      }
		
		/**
			calcGradeListener is an action listener clas for the Calculate button.
		*/
		
		private class calcGradeListener implements ActionListener
		{
			/**
				The actionPerformed method executes when the user
				clicks on the Calculate button.
				@param e The event object.
			*/
			
		/**
			CalcButtonListener is an action listener clas for the Calculate button.
		*/
		}
		
		private class prevBListener implements ActionListener
		{
			/**
				The actionPerformed method executes when the user
				clicks on the prevB button.
				@param e The event object.
			*/
	   }
		
		private class nextBListener implements ActionListener
		{
			/**
				The actionPerformed method executes when the user
				clicks on the next button.
				@param e The event object.
			*/
	   }
		
		private class saveBListener implements ActionListener
		{
			/**
				The actionPerformed method executes when the user
				clicks on the saveB button.
				@param e The event object.
			*/
	   }

			
			
			public void actionPerformed(ActionEvent e)
			{
			
			}
      }

ERRORS
----jGRASP exec: javac -g GradeProgram.java

GradeProgram.java:82: GradeProgram.calcGradeListener is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
private class calcGradeListener implements ActionListener
^
GradeProgram.java:95: GradeProgram.prevBListener is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
private class prevBListener implements ActionListener
^
GradeProgram.java:104: GradeProgram.nextBListener is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
private class nextBListener implements ActionListener
^
GradeProgram.java:113: GradeProgram.saveBListener is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
private class saveBListener implements ActionListener
^
4 errors

Do you understand what the error message is saying?
1) GradeProgram.saveBListener is not abstract
2) does not override abstract method actionPerformed

You have coded "implements ActionListener" for those classes but have NOT added the required method for any of them. Add the required method to make the compiler happy.

Not sure what you trying to achieve with creation of these inner classes but what you can do is to implement ActionListener in your class GradeProgram public class GradeProgram extends JFrame implements ActionListener and provide general implementation of actionPerformed that works for all buttons (positive only one method, negative conditional statements if/else can get messy),which you already have in the place

public void actionPerformed(ActionEvent e) {
   if(e.getActionCommand().equals("Prev")){
     //method call for previous
   }
    else if(e.getActionCommand().equals("Calculate")){
      //call method to do calculation
    }
  }

or provide actionPerformed for each button separately such as

calcGrade.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent ae){
        //call for specific method here
      }
    });

in this case there is no need to add implements ActionListener in class declaration

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.