Advertisement
xlrnxnlx

actionPerformed() - MainWindowController

May 20th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. /*
  2.  
  3.  */
  4. public void actionPerformed(ActionEvent e) {
  5.     /*
  6.          * jbutton here
  7.          */
  8.        
  9.         // jmenuitem
  10.     if (e.getSource() instanceof JMenuItem) {
  11.         JMenuItem menuItem = (JMenuItem) e.getSource();
  12.  
  13.     if (categoryWindow == null) {
  14.         categoryWindow = new CategoryWindow();
  15.                 categoryController = new CategoryController(categoryWindow);
  16.     }
  17.  
  18.     switch (menuItem.getText().toLowerCase()) {
  19.         case "piloto":
  20.                     categoryController.updateAndShowWindow("pilot");
  21.                     break;
  22.                 case "avião":
  23.                     categoryController.updateAndShowWindow("airplane");
  24.                     break;
  25.             }
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement