If I had a method inside the doInBackground() that belongs to other class is it possible to set setProgess() based on changes that happen in that other method of an outside class?
This has nothing to do with SwingWorker and all to do with basic Java. No class can call another classes instance (non-static) methods without doing so on a valid instance of the class. For your code to work, the "other" method must call
Edit: since setProgress is protected and final, your SwingWorker will have to have a public method that the other class can call, and in this method the SwingWorker will need to call its own
As long you are concerned that you have to update the bar, you can achieve it anywhere where you have access to the instance, by calling the appropriate methods. It is not dependent to a method or class. (this is true for every object, in Java).
Per your comment, you should pass a reference to the bar, as a parameter in that method. Otherwise, you won't have access to it.