ProgressMonitorInputStream in socket programming

I have a socket connected client and server. I tried to implement progressMonitorInputStream() to server, the data is transferred perfectly but the Progress Monitor is not visible. I tried implementing it for reading from a file only one side, there

Obtain the Java ProgressMonitor undo event

I have a ProgressMonitor pm and a SwingWorker sw. I want to cancel the SwingWorker when I press the cancel-button on pm. I guess this shouldnt be too hard, and I read some tutorials about SwingWorker and ProgressMonitor, but I can't get this to work.