ajouter plusieurs jPanels à jFrame

Je veux ajouter deux jPanels à une JFrame côté par côté. les deux boîtes sont jpanels et l'extérieur de la boîte est une jframe ajouter plusieurs jPanels à jFrame

J'ai ces lignes de code. J'ai une classe appelée seatinPanel qui s'étend Composite et à l'intérieur de cette classe, j'ai un constructeur et une méthode appelée utilityButtons qui retournent un objet Composite. Je veux le utilityButtons Composite pour être sur le côté droit. le code que j'ai ici n'affiche que les utillityButtons Composite lorsqu'il s'exécute.

public guiCreator()
    {
        setTitle("Passenger Seats");
        //setSize(500, 600);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        Container contentPane = getContentPane();

        seatingPanel seatingPanel1 = new seatingPanel();//need to declare it here separately so we can add the utilityButtons
        contentPane.add(seatingPanel1); //adding the seats
        contentPane.add(seatingPanel1.utilityButtons());//adding the utility buttons

        pack();//Causes this Window to be sized to fit the preferred size and layouts of its subcomponents
        setVisible(true);  
    }

source d'informationauteur dave