I am getting started with Java Swing using Eclipse on MacOS. I read some tutorials; however, I failed to reproduce the results: whenever I copy-paste a sample code, the result is different from what I am supposed to get.
For example, with this I get the empty window, but not the buttons and other stuff.
Another example is code from https://stackoverflow.com/a/14673412/4189299: when I run it, I observe only this (instead of a button and two text fields):
Do I miss something or should I change some Eclipse settings?