If anything, the collapse of Microsoft would produce many smaller companies competing to satisfy the ubiquitous demand for Windows support.
Yes it's true that your products wont stop functioning in the short term, but a dead framework that's no longer supported and updated means you HAVE TO rewrite it using another framework. and we all know how costly rewrites are.
I find the 2 scenarios you listed to have much more in common than not. The main difference is the amount of time you have to react.
The difference is that if Microsoft of Oracle/Sun disappear, the framework does not.
There is another rather unhealthy (IMHO) trend in the market today for DRM to be applied to everything. That can mean that products consumers have paid good money for can effectively just be switched off arbitrarily, and that's why I don't personally buy things that are DRM'd in such a way.
Developing for mobile platforms can be similarly risky. For example, my startup has no current plans to build an iPhone app, even though our users might appreciate it. We simply don't trust that Apple will not just arbitrarily squish us and not even notice/care based on their track record to date, and we would rather invest our money in safe platforms like the web. Apple aren't going to stop shipping a browser that can view modern web sites, it would kill their products.
The bigger issue is they are dependent on frameworks that are still evolving at very high rates. Rapid changes brings a lot of chaos into the equation, which is dangerous from an investment perspective, but that same chaos can lead to unexpectedly strong results as well.