Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes BorderLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "BorderLayout" Watch "BorderLayout" New topic
Author

BorderLayout

madhur jain
Ranch Hand

Joined: Aug 27, 2002
Posts: 49
hi!
why is that if i set borderlayout after adding components to the applet nothing is visible.
this is not the case with other layouts.
madhur.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
It should be possible to make a call to a method
validate() or revalidate() (or something similar) to cause the layout manager to reorganise the components according to its particular layout policy. Look for something like that.
If you have already laid out the components to, say, a FlowLayout then how do you then tell the new BorderLayout to place things (North, South, East, West, Center)?
-Barry
[ September 10, 2002: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
awais syed
Greenhorn

Joined: Mar 17, 2002
Posts: 7
you set layout before adding componenet to container.because ech layout has its own policy about setting the component and it is done only when the layout set before adding the componet.
Originally posted by madhur jain:
hi!
why is that if i set borderlayout after adding components to the applet nothing is visible.
this is not the case with other layouts.
madhur.


awais
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: BorderLayout
 
Similar Threads
Layout...
JTable rows are getting visible in the middile of the JFrame only
advice on drawing a square wave pulse train
Components in each direction of a BorderLayout
applets