Guest User

Untitled

a guest
Nov 15th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. introducir el código aquí
  2. JButton []vect = new JButton[4]; //vector de botones
  3. // y tengo mis botones direccionales
  4. // ya tengo todo cargado si pero me falta es como capturar ambos eventos sin //que se muevan todos los botones al mismo tiempo
  5. JButton up, right , left, down;
  6. public void moverbotones(){
  7. for (int i= 0; i< vect.length; i++)
  8. vect[i] = new JButton();
  9. vect[i].addActionListener(new ActionListener){
  10. public void actionPerformed(ActionEvent e)
  11. right.addActionListener(new ActionListener){
  12. public void actionPerformed(ActionEvent e)
  13. int x = 1;
  14. }; };
  15.  
  16.  
  17. }
Add Comment
Please, Sign In to add comment