My intention is to register the data typed in the window in the object's arraylist, but I can not!
Client class (model): Normal class, with name and address getters and setters.
Main class:
package br.projeto.view;
import java.util.ArrayList;
import br.projeto.model.Cliente;
public class Main {
public static ArrayList <Cliente> clienteDB = new ArrayList<>();
public static void main(String[] args) {
//new Principal();
//new PedidoRapido();
new Cadastrar();
}
}
Class Register (part that matters [window]):
btnCadastrar.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
Main.clienteDB.setNome("");
}
});
The issue is that this Main.clienteDB.setNome
was only placed there to exemplify what I want to do, since I am not able to access any attribute of the Client object. What should I do?