import java.awt.Color;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

/**
 * 
 * @author andrei-eremeev
 *
 */
public class FrameTest {

	public static void main(String[] args) throws Exception {
		SwingUtilities.invokeAndWait(new Runnable() {
			@Override
			public void run() {
				JFrame frame = new JFrame("First");
				frame.setBounds(20, 20, 400, 300);
				frame.getContentPane().setBackground(Color.BLUE);
				frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
				frame.setVisible(true);
			}			
		});
		SwingUtilities.invokeAndWait(new Runnable() {
			@Override
			public void run() {
				JFrame frame = new JFrame("Second");
				frame.setBounds(480, 20, 400, 300);
				frame.getContentPane().setBackground(Color.RED);
				frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
				frame.setVisible(true);
			}			
		});
	}
}
