View Single Post
  #2 (permalink)  
Old 01-19-2008, 01:32 AM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,189
hardwired is on a distinguished road
Code:
Container con = getContentPane(); System.out.println("default layout manager for JFrame = " + getLayout().getClass().getName()); // Looks like you might want the buttons on "pane" to be in the center of your // BorderLayout. Adding a component to this layouts container with no constraint // places it in the center section, by default. This is peculiar to BorderLayout. // So this next line is okay. con.add(pane); // Adding another component to a section/container which already contains a // component will cause the first component to be removed and the second // component to be added. This is the answer to your stated question. // Looks like you might want the JLabel "players" in the south/last // section of the BorderLayout. For this you must use a constraint — see // BorderLayout api Field Summary section for options. To get started try: con.add(pane2, BorderLayout.SOUTH);
Reply With Quote