private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        try{
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        NYM nym = new NYM();
        String message = "";
        if(jTextField3.getText().length()>0)
            message = "Subject:" + jTextField3.getText() + "\n" + jTextArea1.getText();
        else
            message = jTextArea1.getText();
        if(nym.sendMessage(jTextField2.getText(),nymID,jTextField1.getText(),message)){
            JOptionPane.showMessageDialog(this, "Message Sent!","Success",JOptionPane.INFORMATION_MESSAGE);
            Map nymOutbox = new NYM().loadNymOutBox(nymID);
            ((NYMOutboxTableModel) outbox.getModel()).setValue(nymOutbox, outbox);
            MainPage.setNymOutbox(nymOutbox);
            MainPage.refreshMarketNym(jTextField2.getText());
        }else{
            JOptionPane.showMessageDialog(this, "Message sending failed!","Error",JOptionPane.ERROR_MESSAGE);
        }
        }catch(Exception e){
            e.printStackTrace();
        } finally {
           setCursor(Cursor.getDefaultCursor());
           this.dispose();
        }
    }//GEN-LAST:event_jButton1ActionPerformed