Want to get rid of BoxLayout

Hi,
Currently I have some code that uses a BoxLayout, however I want to get rid of the BoxLayout and just have a layout where I can place any object where I want. Here is the code:
private void buildUI(Container container) {
container.setLayout(new BoxLayout(container,
BoxLayout.PAGE_AXIS));
CoordinateArea theArea = new CoordinateArea(this);
container.add(theArea);
label = new JLabel();
          label.setBackground(Color.BLACK);
          label.setForeground(Color.WHITE);
resetLabel();
container.add(label);
This is what it looks like:
http://form17.net/Picture-1.gif
The problem is, whenever I add the JButton to the frame, it positions it under the label (for the position of the mouse) due to the BoxLayout.
Basically I want to be able to position the button (and eventually other objects) wherever I want, but still keep the label (for the position of the mouse) on the very bottom. Help would be appreciated.

Are you sure you want everything to be a direct child of the frame? It looks like you might want to use BorderLayout for the fixed components, and have your button a child of whatever container you put in the centre.
Pete

Similar Messages

Maybe you are looking for