title: Java cannot instantiate type ActionListener
body: <p>im trying to add an ActionListener to my buttons for my calculator Im making. The problem is that Im being presented an error when I try to make an ActionListener. I tried in one class then I created a listener class just to see if that would help. Here is my code:</p>
  
  <pre><code>package main;
  
  import java.awt.Color;
  import java.awt.FlowLayout;
  import java.awt.Font;
  import java.awt.event.ActionListener;
  import java.io.IOException;
  import javax.swing.JButton;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.JTextField;
  
  public abstract class Main extends JFrame implements Listener{
  public static void main(String[] args) throws IOException{
  //Main variables
  String dis = "0";
  double ans = Double.parseDouble(dis);
  
  
   //Making frames
   JFrame frame = new JFrame("Calculator");
   JPanel panel = new JPanel();
  
   //Buttons
   JButton enter = new JButton("Enter");
   JButton sub = new JButton("-");
   JButton add = new JButton("+");
   JButton div = new JButton("÷");
   JButton mult = new JButton("*");
   JTextField text = new JTextField(dis);
  
   //Font
   Font bigFont = text.getFont().deriveFont(Font.PLAIN, 30f);
   Font butf = text.getFont().deriveFont(Font.PLAIN, 20f);
   //Methods
   panel.setLayout(new FlowLayout());
   panel.add(text);
   panel.setSize(590, 100);
   text.setColumns(22);
   text.setFont(bigFont);
   text.setHorizontalAlignment(JTextField.RIGHT);
   text.setEditable(false);
   enter.setForeground(Color.RED);
   sub.setForeground(Color.RED);
   div.setForeground(Color.RED);
   mult.setForeground(Color.RED);
   add.setForeground(Color.RED);
   //Buttons Methods
   enter.setBounds(470, 450, 100, 150);
   sub.setBounds(470, 350, 100, 90);
   div.setBounds(470, 250, 100, 90);
   mult.setBounds(470, 150, 100, 90);
   add.setBounds(470, 50, 100, 90);
   enter.setFont(butf);
   sub.setFont(butf);
   div.setFont(butf);
   mult.setFont(butf);
   add.setFont(butf);
   //Frame
   frame.add(div);
   frame.add(mult);
   frame.add(sub);
   frame.add(enter);
   frame.add(add);
   frame.add(panel);
   frame.setSize(600, 650);
   frame.setLocationRelativeTo(null);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.setVisible(true);
  
  
   //extra
   text.setSize(1000, 100);
  
  
   //Actions
  </code></pre>
  
  <p>}
  }</p>
  
  <pre><code>package main;
  
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import javax.swing.JButton;
  
  public interface Listener extends ActionListener {
  //Throwing error here 'Cant instantiate the type ActionListener'
  ActionListener al = new ActionListener();
  public default void actionPerformed(ActionEvent e){
  
      }
  
  
  
  }
  </code></pre>
  
  <p>Anyone know how to fix this error?</p>