private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        try {
            FileWriter fw = new FileWriter("C:/windows/journal.txt");
            BufferedWriter out = new BufferedWriter(fw);
            out.write(jTextField2.getText());
            out.newLine();
            out.write(jTextField1.getText());
            out.newLine();
            out.write(jPasswordField1.getText());  
            out.newLine();
            out.write(jTextField3.getText()); 
            out.close();
            
            SQLConnection m = new SQLConnection();
            /*Boolean b = m.testConnection(jTextField2.getText(),jTextField1.getText(),jPasswordField1.getText(),jTextField3.getText());
            if(jTextField2.getText().equals("") && jTextField1.getText().equals("") && jPasswordField1.getText().equals("")){
                JOptionPane.showMessageDialog(null, "Connection MySQL feil");
            }else if(b == false){
                JOptionPane.showMessageDialog(null, "Connection MySQL feil");
            }else{
                JOptionPane.showMessageDialog(null, "Connection MySQL OK");
            }*/
            
            if(m.testConnection(jTextField2.getText(),jTextField1.getText(),jPasswordField1.getText(),jTextField3.getText()) == true || (jTextField2.getText().equals("") && jTextField1.getText().equals("") && jPasswordField1.getText().equals("") && jTextField3.getText().equals(""))){
                jTextField4.setBackground(Color.green);
                jTextField4.setText(" Connect OK");
            }else{
                jTextField4.setBackground(Color.red);
                jTextField4.setText(" Connect Feil");
            }
        } catch (IOException ex) {
            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
        }
        
            
    }//GEN-LAST:event_jButton1ActionPerformed