Originally posted by chengx:
Button is added to panel (p1) which has a FlowLayout, so the button "where is my location?" is at its preferred size.
panel p1 is added to a frame with a BorderLayout, so p1 takes up
the entire frame because nothing else is added but the SIZE OF THE BUTTON will NOT change because the layout for p1 is still
Originally posted by snyd1437:
You are correct except, BorderLayout defaults to BorderLayout.CENTER if no location is specified in add() which would mean the panel would be displayed in the center (vert and horiz) of the screen.