private void ConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ConnectActionPerformed

        try {
            if (cardIsConnected) {
                JOptionPane.showMessageDialog(null, "Already connected to: " + CardManager.getTerminal(), "Connection info", JOptionPane.WARNING_MESSAGE);
            } else {
                if (writer.getters.worker.manager.ConnectToCard()) {
                    cardIsConnected = true;
                    ReadWithoutPIN.setEnabled(true);
                    Connect.setEnabled(false);
                    Disconnect.setEnabled(true);
                    EnterPIN.setEnabled(true);
                    TextAreaOutputStream textOut = new TextAreaOutputStream(consoleText);
                    PrintStream outStream = new PrintStream(textOut, true);
                    System.setOut(outStream);
                    JOptionPane.showMessageDialog(null, "Successfully conntected to: " + CardManager.getTerminal(), "Connection info", JOptionPane.INFORMATION_MESSAGE);
                }
            }
        } catch (NoReaderFoundException ex) {
            JOptionPane.showMessageDialog(null, "No terminal found", "Connection info", JOptionPane.ERROR_MESSAGE);
            System.err.println("No terminal found");
            Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
        } catch (CardNotPresentException ex) {
            JOptionPane.showMessageDialog(null, "No card found", "Connection info", JOptionPane.ERROR_MESSAGE);
            System.err.println("No card found");
            Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, "Undefined error", "Connection info", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_ConnectActionPerformed