@Override  
    public void actionPerformed(ActionEvent e)    {
      String i,n; float p;      
      if(e.getSource()==rptbtn)  {
        System.out.printf("===============================\n");  
        pr = prod.readdata("product.txt");
        System.out.printf("          Product List           \n");
        System.out.printf("id    product         price");
        System.out.printf("\n===============================\n");
        for (int j=0; j<prod.rec; j++)
          System.out.printf("%-6s%-10s%10.2f\n",pr[j].id,pr[j].name,pr[j].price);
        System.out.printf("===============================\n");
      }
      if(e.getSource()==savebtn)  {
        i = idtxt.getText();
        n = nametxt.getText();
        p = new Float(pricetxt.getText());
        prod.addData("product.txt",i,n,p);
        idtxt.setText("");
        nametxt.setText("");
        pricetxt.setText("");
        idtxt.requestFocus();
      }
      if(e.getSource()==resetbtn)  {
        idtxt.setText("");
        nametxt.setText("");
        pricetxt.setText("");
      }
    }