I have a JFrame which contains at the moment 4 panels. One of these panels is a keyboard and the other 3 frames are control panels for the keyboard as seen in the following picture:
[![enter image description here](https://i.stack.imgur.com/lcPFe.png)](https://i.stack.imgur.com/lcPFe.png)

I have been trying to find a way to shrink the width of the control panels with GridLayout so that they dont take up the whole width of the frame but unfortnunately my code is not working right. Addionally I would like to push the piano roll at the bottom of the screen. This is my code so far:

```java
JFrame frame = new JFrame(); 
JPanel container = new JPanel();
container.setSize(1000, 1000);
container.setLayout(new GridLayout(5,5));

// add control panels to JPanel
int y = 0;
for(int i =0; i < oscillators.length; ++i) {
  JPanel panel = new JPanel();
  panel.setSize(289, 100);
  panel.setBorder(Utils.WindowDesign.LINE_BORDER);
  panel.setLayout(null);
  container.add(oscillators[i]);
  y+=105;
}

// add keyboard to panel
keyboard = new PianoKeys(this);
keyboard.setFocusable(true);
container.add(keyboard);

// make frame visible
frame.setSize(1000, 1000);
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.setBackground(Color.WHITE);
frame.setLayout(new BorderLayout());
frame.add(container);
frame.setVisible(true);

```

Could someone perhaps explain to me why this doesnt work as expected? I am setting the width of the control panels to 289 and my grid contains 5 columns and 5 rows so I am not sure why the control panels end up expanding to the whole width. I appreciate any help you can provide!