Q:

save data in vector and reuse it in other functions

I recently learned that I should not use global variables when I write code, but in this case I need to save some data in a vector so that if the user clicks on a button, a list is displayed. This list should contain the information stored in the vector. So I was thinking about creating the vector within the click function, but when the function ends, the vector will be deleted. I also thought about creating the vector in the main function, but the click function does not recognize it. So, is it possible to save the information inside the vector and reuse it in other functions within the same class without this variable being globalized?
something like that:
private void btn_saveClientActionPerformed(java.awt.event.ActionEvent evt) {                                               
    Sale sale;
    String clientName = txtFied_Name.getText().toString();
    String product = txtField_product.getText().toString();

    sale = new Sale(clientName, product);

    vector.add(sale); // this is the variable with problems!
}                                              

private void btn_showListActionPerformed(java.awt.event.ActionEvent evt) {                                             

    List list = new List();
    list.addSales(vector);
    list.setVisible(true);
}                                            

A:

I also thought about creating the vector in the main function, but
  the click function does not recognize it.  

In an application, the static void main() method has to be considered as an entry point that should rely on instances of classes to perform the logic and the requirements of your application. So you should declare  the vector as an instance field of one of your class (note that you should favor List over Vector that is really outdated).
So please let me to replace vector by list in your example.   
Supposing your entry point class is called MyApp.
MyApp could be declared as : 
public class MyApp{

  private List<Sale> list = new ArrayList<>();
  public static void main(String[] args){
     new MyApp();
  }

  public MyApp(){
      // init an instance of the class
  }

  // ....
  private void btn_saveClientActionPerformed(java.awt.event.ActionEvent evt) {                                               
        Sale sale;
        String clientName = txtFied_Name.getText().toString();
        String product = txtField_product.getText().toString();

        sale = new Sale(clientName, product);
        // list is now accessible as it is an instance field and a 
        //  instance method of the same class can refer to it
        list.add(sale); 
  } 

}

