@y UI is more the appearance side i.e. the problem in your first case, but not precisely. I think of UX as UI++ - UI is *only* how you interact with software, how it communicates with you, etc. UX is that with the addition of thinking about your overall experience, taking into account things external to the software as well, with questions like "why are users here and what do they actually want to get from the software".
(Disclaimer: I'm a novice UXer, not an expert)