private void saveMenuItem_actionPerformed(ActionEvent event) {
        JFileChooser fileChooser = createFileChooser();
        fileChooser.setDialogType(JFileChooser.SAVE_DIALOG);
        fileChooser.showSaveDialog(this);
        File file = fileChooser.getSelectedFile();
        if (file != null) {
            defaultDirectory = fileChooser.getCurrentDirectory();
            try (RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw")) {
                randomAccessFile.writeBytes(receivedText.getText());
                randomAccessFile.close();
            }
            catch (Exception ex) {
                Logger.getLogger(MonitorConsole.class.getName()).log(Level.SEVERE, "saveMenuItem_ActionPerformed", ex);
            }
        }
    }