-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFXMLDocumentController.java
More file actions
72 lines (59 loc) · 1.94 KB
/
FXMLDocumentController.java
File metadata and controls
72 lines (59 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package arduinoradar;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import javax.swing.JOptionPane;
/**
*
* @author mkuta
*/
public class FXMLDocumentController implements Initializable {
private Label label;
@FXML
private TextField tf_user;
@FXML
private PasswordField tf_pw;
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
@FXML
private void Login(ActionEvent event) {
sorgular sor = new sorgular();
boolean sordu=sor.kullaniciCek(tf_user.getText(),tf_pw.getText());
if(sordu){
try{
Stage ne = (Stage) tf_user.getScene().getWindow();
ne.close();
Stage stage=new Stage();
Parent root;
root = FXMLLoader.load(getClass().getClassLoader().getResource("arduinoradar/ArduinoVeri.fxml"));
stage.setScene(new Scene(root));
stage.show();
}
catch(Exception e){
System.out.println(e.toString());
}
}
else{
tf_user.setText("");
tf_pw.setText("");
JOptionPane.showMessageDialog(null, "Kullanıcı adınız ya da şifreniz hatalı!", "BAŞARISIZ GİRİŞ", JOptionPane.ERROR_MESSAGE);
}
}
}