Advertisement
Guest User

rps

a guest
Nov 26th, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public RPSwindow() {
  2. initComponents();
  3. Action action = new Action("New Game");// set both new game buttons
  4. newgamebutton.setAction(action);
  5. newgameitem.setAction(action);
  6. }
  7.  
  8.  
  9. public class Action extends AbstractAction{
  10. Action(String name ) {
  11. super(name); // sets the name of the menu item/button/etc
  12. }
  13. // concets the new game buttons
  14. @Override
  15. public void actionPerformed(ActionEvent ae) {
  16. setup();// metod anrop som skall ske när man trycker på New Game
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement