Advertisement
Guest User

Trabalho de programação - TelaprincipalController

a guest
Dec 19th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.00 KB | None | 0 0
  1. package Controllers;
  2. import java.net.URL;
  3. import java.util.ResourceBundle;
  4.  
  5.         /*Trabalho de programação
  6.         Alunos: Jair Junior e Rafael Almeida*/
  7.  
  8. import principal.Telamatrizes;
  9. import principal.Telaprincipal;
  10. import principal.Telavetores;
  11. import principal.Telavetoresematrizes;
  12. import javafx.event.ActionEvent;
  13. import javafx.event.EventHandler;
  14. import javafx.fxml.FXML;
  15. import javafx.fxml.Initializable;
  16. import javafx.scene.control.Button;
  17. import javafx.stage.Stage;
  18.  
  19. public class TelaprincipalController implements Initializable{
  20.  
  21.     @FXML
  22.     private ResourceBundle resources;
  23.  
  24.     @FXML
  25.     private URL location;
  26.  
  27.     @FXML
  28.     private Button btn_vetor, btn_matriz, btn_vetoresematrizes;
  29.    
  30.     @Override
  31.     public void initialize(URL url, ResourceBundle bundle)
  32.     {
  33.         //Evento de clique no botão vetor
  34.         btn_vetor.setOnAction(new EventHandler<ActionEvent>()
  35.                 {
  36.                     @Override
  37.                     public void handle(ActionEvent event)
  38.                     {
  39.                         try {
  40.                             new Telavetores().start(new Stage());
  41.                             Telaprincipal.getStage().close();
  42.                             } catch (Exception e) {
  43.                             e.printStackTrace();
  44.                             }
  45.                     }
  46.                 });
  47.         //Evento de clique no botão matriz
  48.         btn_matriz.setOnAction(new EventHandler<ActionEvent>()
  49.                 {
  50.                     @Override
  51.                     public void handle(ActionEvent event)
  52.                     {
  53.                         try {
  54.                             new Telamatrizes().start(new Stage());
  55.                             Telaprincipal.getStage().close();
  56.                             } catch (Exception e) {
  57.                             e.printStackTrace();
  58.                             }
  59.                     }
  60.                 });
  61.         //Chama a tela de vetores e matriz
  62.         btn_vetoresematrizes.setOnAction(new EventHandler<ActionEvent>()
  63.                 {
  64.                     @Override
  65.                     public void handle(ActionEvent event)
  66.                     {
  67.                         try {
  68.                             new Telavetoresematrizes().start(new Stage());
  69.                             Telaprincipal.getStage().close();
  70.                             } catch (Exception e) {
  71.                             e.printStackTrace();
  72.                             }
  73.                     }
  74.                 });
  75.        
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement