I have tried out the following code from the headfirst java book.(after making a few changes). It is working as it should i.e. 'click here!' is displayed in the text area when I click on the button,but there is one problem. Here is the code :-
I want the panel to appear in the center but it appears in the north. What seems to be the problem??
My apologies if someone has already asked a question similar to this.
posted 4 years ago
There seems to be no problem. The layouts occupy the spaces on the screen. If your other zones ie. NORTH,WEST,SOUTH are not set then the other zones occupy the remaining spaces. In order that it should appear in the center, try adding some other components that will occupy the rest of the screen space.