In java please Show code and reqired output The code to ajus
In java please. Show code and reqired output. The code to ajust is below the question.
Adjust the code so that:
  the Buy button is enabled whenever something is selected from the Products list.     whenever the Buy button is pressed, the name of the item selected (i.e., just the name, not the other data) from the Products list will appear in the Shopping Cart list.    at any time, the Total Price field should always show the total price of all items currently in the shopping cart.   
 Make more changes so that:
  the Return button is enabled whenever something is selected from the Shopping Cart list.    whenever the Return button is pressed, the selected item is removed from the shopping cart.  the Checkout button is disabled whenever the ShoppingCart is empty and enabled otherwise.
 When the Checkout button is pressed, the following should happen:
  the Shopping Cart contents should be packed using the model\'s packBags() method.
  the Shopping Cart list should display the packed items, showing the description of all Carryable items (i.e., GroceryBags and unpacked GroceryItems).
 
  the Buy and Return buttons should be disabled and the Products list should be disabled.
 
  the Checkout button should have its text changed to \"Restart Shopping\" and should remain enabled regardless of whether or not anything is in the cart.
 
  A receipt for the items purchased should be printed to the System console showing each item\'s description and price, appropriately aligned as shown below. The total should also be shown.
 
 Mega-Sized Chocolate Icecream       67.93 Toilet Paper - 48 pack              40.96 SnackPack Pudding                    0.99 Breyers Chocolate Icecream           2.99 Yoplait Yogurt 6-pack                4.74 Extra-Large Eggs                     1.79 2L Sealtest Milk                     2.99 Smart-Ones Frozen Entrees            1.99 Gold Seal Salmon                     1.99 ----------------------------------------- TOTAL                              126.37
 
 After a checkout has been done, the following behavior must occur:
 
  if a Grocery Bag is selected from the Shopping Cart list, its contents should appear in the Contents list (see image on the next page).
 
  if an unpacked item is selected from the Shopping Cart list, nothing should appear in the Contents list.
 When the Restart Shopping button (previously called Checkout) has been pressed, the application should reset with an empty shopping cart, a Total Cost of $0.00 and an empty contents list.
GroceryStoreApplication.java
Solution
import java.io.*;
 import java.lang.String;
 import javax.swing.JFrame;
 import javax.swing.*;
 import java.awt.*;
 import javax.swing.ImageIcon;
 import javax.imageio.ImageIO;
 import java.util.*;
 import java.awt.event.*;
 import java.awt.GraphicsEnvironment;
 import java.awt.GraphicsDevice;
public class GroceryStoreApplication extends JFrame{
 public static void main(String[] args) {
 GroceryStoreApplication frameTabel=new GroceryStoreApplication();
 }
DefaultListModel<String> model= new DefaultListModel<String>();
 JList Products=new JList(model);
 DefaultListModel model1= new DefaultListModel();
 JList ShoppingCart=new JList(model1);
 DefaultListModel model2= new DefaultListModel();
 JList Contents=new JList(model2);
 //Create scroll panes for list boxes
 JScrollPane sp=new JScrollPane(Products);
 JScrollPane sp1=new JScrollPane(ShoppingCart);
 JScrollPane sp2=new JScrollPane(Contents);
 JButton buy = new JButton(\"Buy\");
 JButton retur = new JButton(\"Return\");
 JButton checkout = new JButton(\"Checkout\");
 JLabel lprod=new JLabel(\"Products\");
 JLabel lshop=new JLabel(\"Shopping Cart\");
 JLabel lcont=new JLabel(\"Contents\");
 JLabel ltot=new JLabel(\"Total Price: \");
 JTextField total = new JTextField(\"$0.00\");
 GroceryStoreApplication() {
 super(\"GroceryStoreApplication\");
 setSize(300, 200);
 setExtendedState(JFrame.MAXIMIZED_BOTH);
 setTitle(\"GroceryStoreApplication\");
 setBackground(new java.awt.Color(0, 0, 1));
 setLocation(500, 280);
 setLayout(null);
 sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
  sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  sp1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
  sp1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  sp2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
  sp2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  lprod.setBounds(50, 20, 120, 30);
 lshop.setBounds(420, 20, 200, 30);
 lcont.setBounds(790, 20, 200, 30);
 sp.setBounds(50, 60, 350, 550);
 buy.setBounds(50, 620, 350, 30);
 sp1.setBounds(420, 60, 350, 550);
 retur.setBounds(420, 620, 350, 30);
 sp2.setBounds(790, 60, 550, 550);
 checkout.setBounds(790, 620, 210, 30);
 ltot.setBounds(1040, 620, 100, 30);
 total.setBounds(1120, 620, 210, 40);
 add(lprod);
 add(lshop);
 add(lcont);
 add(ltot);
 add(sp);
 add(sp1);
 add(sp2);
 add(total);
 add(buy);
 add(retur);
 add(checkout);
 buy.setEnabled(false);
 retur.setEnabled(false);
 checkout.setEnabled(false);
 total.setHorizontalAlignment(JTextField.RIGHT);
 for (String i : Groceryitems) {
 model.addElement(i);
 }
 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 setVisible(true);
 actionlogin();
 }
 public void actionlogin(){
 buy.addActionListener(new ActionListener(){
 public void actionPerformed(ActionEvent ae) {
 }
});
 retur.addActionListener(new ActionListener() {
 public void actionPerformed(ActionEvent ae) {
 }
 });
}}



