import java.awt.*;
import javax.swing.*;

public class frame2 extends JFrame 
{
		JScrollPane PainelScroll_1, PainelScroll_2;
		JPanel Painel1, Painel2; 

    	public frame2() 
    	{
				getContentPane().setLayout(new GridLayout(1, 2));
				getContentPane().add(PainelScroll_1 = new JScrollPane() );
				PainelScroll_1.add(Painel1 = new JPanel() );
				Painel1.add(new JLabel("Painel 1"));
				Painel1.setBackground(Color.blue);
  				getContentPane().add(PainelScroll_2 = new JScrollPane() );
				PainelScroll_2.add(Painel2 = new JPanel() );
				Painel2.add(new JLabel("Painel 2"));
				Painel2.setBackground(Color.red);
  		
	       		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        		setSize(500, 300);
        		setVisible(true);
        }
        public static void main (String args [])
        {
        		new frame2();
        }	

}