Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. Task t = new Task() {
  2.  
  3. @Override
  4. protected Object call() throws Exception {
  5.  
  6. Platform.runLater(() -> {
  7. try {
  8.  
  9. new SisgeFX().start();
  10. } catch (IOException ex) {
  11. Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
  12. }
  13. });
  14. return null;
  15. }
  16. };
  17. region.visibleProperty().bind(t.runningProperty());
  18. pi.visibleProperty().bind(t.runningProperty());
  19. Thread th = new Thread(t);
  20. th.start();
  21.  
  22. @FXML
  23. private void sysLogin() {
  24. String user = ctfUserLogin.getText();
  25. String pass = ctfPassLogin.getText();
  26. LoginDAO loginDAO = DAOFactory.make(LoginDAO.class);
  27. Login login = loginDAO.getLogin(user, pass);
  28.  
  29. if (login != null) {
  30. runThread(); // aqui chamo a Thread postado acima.
  31. ctfPassLogin.setStyle(null);
  32. ctfUserLogin.setStyle(null);
  33. } else {
  34. ctfPassLogin.clear();
  35. ctfUserLogin.clear();
  36. ctfPassLogin.setStyle("-fx-border-color:red;");
  37. ctfUserLogin.setStyle("-fx-border-color:red;");
  38. //new ShakeTransition(vBox).play();
  39. new WobbleTransition(vBox).play();
  40. //new TadaTransition(vBox).play();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement