• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem adding JPanel to the desired location.  RSS feed

 
akshay nayak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Neelesh Srinivasan
Greenhorn
Posts: 11
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!