Linked list (polynomials) need help from expert since i want actionPerformed but
ID: 3652727 • Letter: L
Question
Linked list (polynomials) need help from expert since i want actionPerformed buttons to do something the basic i want it to do: is add and remove terms from a polynomial how to use method takes a polynomial and real number and multiply them and return new polynomial. how to use method display polynomials in descending order of degrees. 9x16 + 3.4X5 + 1.89X 2 + 0.45 import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.LinkedList; import java.util.List; public class ListDemo extends JFrame { JButton addFrontButton = new JButton("Add Front"); JButton addMiddleButton = new JButton("Addd Middle"); JButton addRearButton = new JButton("Add Rear"); JButton removeFrontButton = new JButton("Remove Front"); JButton removeMiddleButton = new JButton("Remove Middle"); JButton removeRearButton = new JButton("Remove Rear"); JButton displayListButton = new JButton("Display List"); LinkedList myList = new LinkedList(); public static void main() { ListDemo demo = new ListDemo(); demo.setSize(400,200); demo.setDefaultCloseOperation(EXIT_ON_CLOSE); demo.setTitle("List Demo"); demo.createGUI(); demo.setVisible(true); } public void createGUI() { Container window = getContentPane(); window.setLayout(new FlowLayout()); addFrontButton.addActionListener(new AddFrontAction()); window.add(addFrontButton); addMiddleButton.addActionListener(new AddMiddleAction()); window.add(addMiddleButton); addRearButton.addActionListener(new AddRearAction()); add(addRearButton); removeFrontButton.addActionListener(new removeFrontAction()); window.add(removeFrontButton); removeMiddleButton.addActionListener(new removeMiddleAction()); window.add(removeMiddleButton); removeRearButton.addActionListener(new removeRearAction()); window.add(removeRearButton); displayListButton.addActionListener(new DisplayListAction()); window.add(displayListButton); } //make any changes in the object private class AddFrontAction implements ActionListener{ public void actionPerformed(ActionEvent e) { ??? } } private class DisplayListAction implements ActionListener{ public void actionPerformed(ActionEvent e) { ????? } } }