Matrices between Java classes

0

I have a question like they would do to use a matrix in several classes, my problem is that I have to create buttons in java but inside them I can not create methods.

        modificacion_Usuario.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {

        //aqui trabajaria la matriz, pero no me deja llamar metodos.
        }
    });  
    
asked by Selvin Lisandro 23.03.2018 в 21:31
source

1 answer

0

Create the methods outside the methods of the buttons and then call the methods within the method of the button method.

modificacion_Usuario.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {

    algunMetodo();
    }
}); 
void algunMetodo(){
// codigo
}
    
answered by 23.03.2018 в 23:23