title: JAVA - Exception only if I run it with debug
body: <p>If I run the following code (JAVAfx) with Debug (Eclipse), I get an Exception. 
  Normal run working fine. 
  I run it when the server is run too, and the server is recognize this client.</p>
  
  <p>This is the exception:</p>
  
  <pre><code>    Exception in Application start method
  djava.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
      at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
  Caused by: java.lang.RuntimeException: Exception in Application start method
      at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$150(Unknown Source)
      at com.sun.javafx.application.LauncherImpl$$Lambda$50/24970616.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Caused by: java.lang.NullPointerException
      at javaNetFinal.Client.delColumnPane(Client.java:122)
      at javaNetFinal.Client.updateStage(Client.java:333)
      at javaNetFinal.Client.start(Client.java:75)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$156(Unknown Source)
      at com.sun.javafx.application.LauncherImpl$$Lambda$85/17408914.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$169(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$$Lambda$47/16153462.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$null$167(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$$Lambda$49/32223832.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl.lambda$runLater$168(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$$Lambda$48/20929065.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.lambda$null$144(Unknown Source)
      at com.sun.glass.ui.win.WinApplication$$Lambda$37/29854731.run(Unknown Source)
      ... 1 more
  Exception running application javaNetFinal.Client
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>    public class Client  extends Application {
  
      DynamicTable tbl = new DynamicTable(0,null,null);
  
      PaneQuery paneQuery;
      private Socket socket;
  
      // Input and output streams from/to server
      private ObjectInputStream fromServer;
      private DataOutputStream toServer;
      private String host = "localhost";
  
      private BorderPane viewPane = new BorderPane();                 // include: upperPaneOnViewPane (Queries, Filter) Table, edit
      private BorderPane topViewPane = new BorderPane();
      private BorderPane upperPaneOnViewPane = new BorderPane();      // include: Queries, Filter 
  
      private int columnCount;
      private  Student[] rows;
      private  String[] columnName;
  
      public void start(Stage primaryStage) {
  
          connectToServer();
          refreshDefultTable();
  
          BorderPane mainPane = new BorderPane();
  
          // Top View
          topViewPane.setPadding(new Insets(5,5,30,5));
          topViewPane.setLeft(initRefreshTable());    // position of the first part in the top pane
          //topViewPane.setStyle("-fx-border-color: black;");
  
          // Center View
          upperPaneOnViewPane.setPadding(new Insets(5,5,10,5));
          //upperPaneOnViewPane.setLeft(paneQuery.createPane());  // Queries
          upperPaneOnViewPane.setRight(setPaneFilterOnTable());   // Filter
  
          viewPane.setTop(upperPaneOnViewPane);                   // Queries + Filter
          viewPane.setBottom(setPaneEditTable());                 // Edit Table
  
          mainPane.setPadding(new Insets(5,5,5,5));
          mainPane.setTop(topViewPane);
          mainPane.setCenter(viewPane);
  
          updateStage();
          Scene scene = new Scene(mainPane, 700, 250);
          primaryStage.setMaximized(true);
          primaryStage.setTitle("----"); // Set the window title
          primaryStage.setScene(scene); // Place the scene in the window
          primaryStage.show(); // Display the window
          primaryStage.setAlwaysOnTop(true);
      }
  
      public Pane initRefreshTable() {
  
          GridPane initRefreshPane = new GridPane();
          initRefreshPane.setVgap(4);
          initRefreshPane.setHgap(10);
          initRefreshPane.setPadding(new Insets(5,5,5,5));
  
          Button btnInitial= new Button("Init DataBase");
          btnInitial.setOnAction(e-&gt; {
              new ImportMySQLDB();
              refreshDefultTable();
              updateStage();
          });
          initRefreshPane.add(btnInitial,0,0);
          Button btnRefresh= new Button("Refresh Table View");
          btnRefresh.setOnAction(e-&gt; {
              System.out.println("dd");
              refreshDefultTable();
  //          String sql = "SELECT * FROM STUDENT";
  //          sendAndGetFromServer(sql);
          });
  
          initRefreshPane.add(btnRefresh,1,0);
          Label lblLastSave = new Label("Last Saved: ");
          initRefreshPane.add(lblLastSave,0,1);
          Label lblDateSave = new Label(new Date().toString());
          initRefreshPane.add(lblDateSave,1,1);
  
          return initRefreshPane;
      }
  
      public Pane delColumnPane() {
          GridPane delColumnPane = new GridPane();
          delColumnPane.setVgap(4);
          delColumnPane.setHgap(10);
          delColumnPane.setPadding(new Insets(5,5,5,5));
  
          ObservableList&lt;String&gt; columnList = 
                  FXCollections.observableArrayList(this.columnName.length&gt;0? Student.getHeadField(this.columnName):null);
          columnList.remove("ID");
          ComboBox&lt;String&gt; cbColumnToDel = new ComboBox&lt;String&gt;(columnList);
          Button btnDelColumn= new Button("Delete");
  
          delColumnPane.add(cbColumnToDel, 0, 0);
          delColumnPane.add(btnDelColumn,1,0);
  
          cbColumnToDel.setPromptText("delete column...");
          cbColumnToDel.setOnAction(e -&gt;{
              btnDelColumn.setDisable(false);
          });
  
          btnDelColumn.setDisable(true);
  
  
          btnDelColumn.setOnAction(e -&gt;{
  //          showDialog("\n\n  Are you sure you want delete column: "+cbColumnToDel.getValue()+"?");
              System.out.println(tbl.toString());
              String sql = "ALTER TABLE STUDENT";
              sql=sql +" DROP COLUMN "+Student.getField(cbColumnToDel.getValue());
              sendAndGetFromServer(sql);
              System.out.println(tbl.toString());
              columnList.remove(Student.getField(cbColumnToDel.getValue()));
              cbColumnToDel.setPromptText("delete column...");
              btnDelColumn.setDisable(true);
              updateStage();
              System.out.println(tbl.toString());
          });
  
          return delColumnPane;
      }
  
      public Pane setPaneFilterOnTable() {
  
          GridPane filterTable = new GridPane();
          filterTable.setVgap(4);
          filterTable.setHgap(10);
          filterTable.setPadding(new Insets(5,5,5,5));
  
          Label lblSort = new Label("Sort Columns By:");
          filterTable.add(lblSort, 0, 0);
  
          ObservableList&lt;String&gt; columnOptions = 
                  FXCollections.observableArrayList(
                          //tbl.getColumnName()
                          );
          ComboBox&lt;String&gt; cbFirstChoiseColumn = new ComboBox&lt;String&gt;(columnOptions);
          cbFirstChoiseColumn.setPromptText("Select first column...");
          cbFirstChoiseColumn.setPrefWidth(210);
          filterTable.add(cbFirstChoiseColumn, 1, 0);
  
          ComboBox&lt;String&gt; cbSecondChoiseColumn = new ComboBox&lt;String&gt;(columnOptions);
          cbSecondChoiseColumn.setPromptText("Select second column...");
          cbSecondChoiseColumn.setPrefWidth(210);
          cbSecondChoiseColumn.setDisable(true);
  
          cbFirstChoiseColumn.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
              @Override
              public void handle(ActionEvent event) {
                  cbSecondChoiseColumn.setDisable(false);
              }
          });
  
          filterTable.add(cbSecondChoiseColumn, 1, 1);
  
          Label lblOrder = new Label("Order By:");
          filterTable.add(lblOrder, 2, 0);
  
          ObservableList&lt;String&gt; orderOptions = 
                  FXCollections.observableArrayList(
                          "▲ Ascending", "▼ Descending" );
          ComboBox&lt;String&gt; cbOrder = new ComboBox&lt;String&gt;(orderOptions);
          cbOrder.setPromptText("Ascending");
          cbOrder.setPrefWidth(150);
          filterTable.add(cbOrder, 3, 0);
  
          return filterTable;
      }
  
      public Pane setPaneEditTable() {
  
          GridPane editTable = new GridPane();
          editTable.setVgap(4);
          editTable.setHgap(10);
          editTable.setPadding(new Insets(15,5,15,5));
  
          RadioButton rbEditRow = new RadioButton();
          rbEditRow.setText("Edit");
          editTable.add(rbEditRow,0,0);
          rbEditRow.setSelected(true);
  
  
          RadioButton rbAddRow = new RadioButton();
          rbAddRow.setText("Add");
          editTable.add(rbAddRow,1,0);
  
          RadioButton rbDeleteRow = new RadioButton();
          rbDeleteRow.setText("Delete");
          editTable.add(rbDeleteRow,2,0);
  
          rbEditRow.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
              @Override
              public void handle(ActionEvent event) {
                  rbAddRow.setSelected(false);    
                  rbDeleteRow.setSelected(false);
              }
          });
  
          rbAddRow.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
              @Override
              public void handle(ActionEvent event) {
                  rbEditRow.setSelected(false);   
                  rbDeleteRow.setSelected(false);
              }
          });
  
          rbDeleteRow.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
              @Override
              public void handle(ActionEvent event) {
                  rbEditRow.setSelected(false);   
                  rbAddRow.setSelected(false);
              }
          });
  
          Button btnApply= new Button("Apply");
          editTable.add(btnApply,0,1);
  
          return editTable;
      }
  
      private void connectToServer(){
          try{
              // Create a socket to connect to the server
              socket = new Socket(host, 8000);
              // Create an output stream to send data to the server
              toServer = new DataOutputStream(socket.getOutputStream());
              // Create an input stream to receive data from the server
              fromServer = new ObjectInputStream(socket.getInputStream());
          }
          catch (Exception ex){
              ex.printStackTrace();
          }
      }
  
      private void sendAndGetFromServer(String sqlQuery){
          new Thread(() -&gt;{
              try{
  
                  System.out.println("a1");
                  // Send sql query to server
                  toServer.writeUTF(sqlQuery);
                  // Get notification from the server
                  this.rows =  (Student[])fromServer.readObject();
                  this.columnCount= fromServer.readInt();
                  this.columnName= (String[])fromServer.readObject();
                  setRowsInTable();
              }
              catch(SocketException ex){
                  try{
                      socket.close();
                  } 
                  catch (IOException e){
                      ex.printStackTrace();
                  }
              } 
              catch (Exception ex){
                  ex.printStackTrace();
              }
          }).start();
          System.out.println("end");
      }
  
      public void setRowsInTable(){
  
          tbl = new DynamicTable(columnCount,  rows,  columnName);
          tbl.buildTable();
          Platform.runLater(new Runnable() {
                 @Override
                 public void run() {
                     viewPane.setCenter(tbl);
                 }
              });
      }
  
      public void refreshDefultTable(){
          String sql = "SELECT * FROM STUDENT";
          sendAndGetFromServer(sql);
      }
  
      public void updateStage(){
  
          topViewPane.setRight(delColumnPane());  // position of the second part in the top pane
          viewPane.setCenter(tbl);                // Table
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>what is the problem?
  I need the debug!</p>