I have a working code which creates a window with a text area. The code is here. I try to figure out how this code works. A lot of things are clear:
- The main-method creates an instance of the TextAreaDeom class (which is subclass of the JFrame). In other words, the main-method creates a window.
- In the main-method we set some "parameters" of the window and make it visible.
It is not clear to me, in which place we put the text area in the window. I see that the text area is created right before the constructor. I also see that in the constructor we set some "parameters" of the text area (setText). I also see that in the constructor we create a a scrolling area and set some parameters for it. I see that the scrolling area is "connected" to the text area (since we use the instance of the text area to create the scrolling area). I also see that we create an object called "content" (using the current window) and we "add" the scrolling area to the "content".
But at which place the text area is added to the window? May be I can say that the text area is added to the scrolling area and the scrolling area is added to the "content" and the content is a part of the window-object?