package net.hive.controller;

import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;

import java.net.URL;
import java.util.ResourceBundle;

/**
 * Created by kharlashkin on 09.03.2017.
 * ,    
 */
public class ControllerBD implements Initializable {

    public TextField routToDataBase;            //    
    public PasswordField password;              //  
    public TextField login;                     //  
    public String wayToDB;
    public String passDB;
    public String loginDB;

    public void saveChanges() {
        System.out.println(wayToDB);

        Alert alert = new Alert(Alert.AlertType.INFORMATION);
        alert.setTitle("Firebird SQL v2.5");
        alert.setHeaderText("   :");
        alert.setContentText(wayToDB);

        alert.showAndWait();
    }

    @Override
    public void initialize(URL location, ResourceBundle resources) {
        wayToDB = routToDataBase.getText();
        passDB = password.getText();
        loginDB = login.getText();
    }


    //String rout = routToDataBase.getText();
    //String pass = password.getText();






    /*public void saveChanges() {
        url = login.getText();
        if (url.equals(null)){
            url = "APP_ADMIN";
        }
    }*/
}
@@ -29,43 +29,8 @@
 %0D%0A%0D%0A
-import javafx.fxml.Initializable;%0D%0A
 impo
@@ -151,66 +151,8 @@
 %0D%0A%0D%0A
-import java.net.URL;%0D%0Aimport java.util.ResourceBundle;%0D%0A%0D%0A
 /**%0D
@@ -201,13 +201,45 @@
 %0A * 
-,    
+%D0%9A%D0%BE%D0%BD%D1%82%D1%80%D0%BE%D0%BB%D0%BB%D0%B5%D1%80, %D0%B4%D0%BB%D1%8F %D0%B8%D0%B7%D0%BC%D0%B5%D0%BD%D0%B5%D0%BD%D0%B8%D1%8F %D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B5%D0%BA %D0%91%D0%94
 %0D%0A *
@@ -271,33 +271,8 @@
 rBD 
-implements Initializable 
 %7B%0D%0A%0D
@@ -323,19 +323,34 @@
      // 
-   
+%D0%9F%D1%83%D1%82%D1%8C %D0%BA %D0%B1%D0%B0%D0%B7%D0%B5 %D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85
 %0D%0A    pu
@@ -386,33 +386,51 @@
              // 
- 
+%D0%9F%D0%B0%D1%80%D0%BE%D0%BB%D1%8C %D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8F
 %0D%0A    public Tex
@@ -470,21 +470,37 @@
  // 
- 
+%D0%98%D0%BC%D1%8F %D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8F
 %0D%0A    p
-ublic
+rivate
  Str
@@ -510,37 +510,38 @@
  wayToDB;%0D%0A    p
-ublic
+rivate
  String passDB;%0D
@@ -546,21 +546,22 @@
 ;%0D%0A    p
-ublic
+rivate
  String 
@@ -635,32 +635,53 @@
 ntln(wayToDB);%0D%0A
+        initialize();
 %0D%0A        Alert 
@@ -804,19 +804,34 @@
 erText(%22
-   
+%D0%9F%D1%83%D1%82%D1%8C %D0%BA %D0%91%D0%94 %D0%91%D0%B0%D1%81%D1%82%D0%B8%D0%BE%D0%BD%D0%B0
 :%22);%0D%0A  
@@ -868,18 +868,16 @@
 ToDB);%0D%0A
-%0D%0A
         
@@ -906,93 +906,115 @@
     
-%7D%0D%0A%0D%0A    @Override%0D%0A    public void initialize(URL location, ResourceBundle resources
+    System.out.println(passDB);%0D%0A        System.out.println(loginDB);%0D%0A    %7D%0D%0A%0D%0A    public void initialize(
 ) %7B%0D
@@ -1141,243 +1141,70 @@
     
-%7D%0D%0A%0D%0A%0D%0A    //String rout = routToDataBase.getText();%0D%0A    //String pass = password.getText();%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A    /*public void saveChanges() %7B%0D%0A        url = login.getText();%0D%0A        if (url.equals(null))%7B%0D%0A            url = %22APP_ADMIN%22
+    if (passDB != null)%7B%0D%0A            password.setText(passDB)
 ;%0D%0A 
@@ -1222,9 +1222,9 @@
    %7D
-*/
 %0D%0A%7D
+%0D%0A

Update ControllerBD.java