I have had good luck with exercising knee-replacement candidates on a stationary bike and certainly on an upper body ergometer. Upper body ergometers are pedal-like devices for your arms. They can be found in some gyms and physical therapy centers. If you are able to tolerate short durations on a bike and possibly a stepper, try three to five short duration sessions (one to 10 minutes) spaced throughout the day.
If the aerobic activity is completely out until after your surgery, you can use the time to start a strength-training program. Most of the exercises can be done from a seated position, and many knee-replacement candidates can even do simple quarter squats without a problem.
Remember, you should always check with your physician before trying any new activity. Good luck!