judging by the picture, you need a grid layout, just to create 2 columns (2 panels), and then you can already "shove it into a mess." unfortunately, if you use FlowLayout and do not set the width of the components, they can crawl into one line, so it’s better to use a specialized layout manager right away. The code creates a window, 2 columns with 3 panels each. each panel has a different height:
/// add random height text area private static void updateLabel(JPanel panel) { Random r = new Random(); int random = r.nextInt(15) + 1; TextArea textArea = new TextArea(random, 15); panel.add(textArea); } public static void main(String[] args) { // create and customize frame JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); f.setLayout(new GridLayout(1, 2)); f.setSize(400, 400); // create panels JPanel left = new JPanel(); left.setBackground(Color.YELLOW); JPanel right = new JPanel(); right.setBackground(Color.BLUE); // add main panels to the frame f.add(left); f.add(right); // set layout managers left.setLayout(new BoxLayout(left, BoxLayout.Y_AXIS)); right.setLayout(new BoxLayout(right, BoxLayout.Y_AXIS)); // add components JPanel black = new JPanel(); black.setBackground(Color.BLACK); JPanel red = new JPanel(); red.setBackground(Color.RED); JPanel green = new JPanel(); green.setBackground(Color.GREEN); JPanel cyan = new JPanel(); cyan.setBackground(Color.CYAN); JPanel gray = new JPanel(); gray.setBackground(Color.GRAY); JPanel orange = new JPanel(); orange.setBackground(Color.ORANGE); left.add(black); left.add(red); left.add(green); right.add(cyan); right.add(gray); right.add(orange); updateLabel(black); updateLabel(red); updateLabel(green); updateLabel(cyan); updateLabel(gray); updateLabel(orange); f.setVisible(true); }