0

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):

enter image description here

Do I miss something or should I change some Eclipse settings?

Community
  • 1
  • 1
Roman
  • 2,055
  • 4
  • 19
  • 52

1 Answers1

-1

In the first example you should only get simple frame with no buttons at all. Just a frame with a title. Here is a Simple Example.

On the other case in the second example I tried and example is fine. Maybe you should check that you copied all code?

Zizouz212
  • 4,728
  • 5
  • 39
  • 65
nikaco
  • 1
  • 2