Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- introducir el código aquí
- JButton []vect = new JButton[4]; //vector de botones
- // y tengo mis botones direccionales
- // ya tengo todo cargado si pero me falta es como capturar ambos eventos sin //que se muevan todos los botones al mismo tiempo
- JButton up, right , left, down;
- public void moverbotones(){
- for (int i= 0; i< vect.length; i++)
- vect[i] = new JButton();
- vect[i].addActionListener(new ActionListener){
- public void actionPerformed(ActionEvent e)
- right.addActionListener(new ActionListener){
- public void actionPerformed(ActionEvent e)
- int x = 1;
- }; };
- }
Add Comment
Please, Sign In to add comment