package me.chris.FourYearsForYou;

import java.awt.Color;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SpringLayout;

import java.awt.image.BufferedImage;

import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.border.LineBorder;

import org.imgscalr.Scalr;

import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;

public class MainWindow extends JFrame
{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2451788337777377959L;
	JLabel			banner;
	SpringLayout	springLayout;
	BufferedImage	scaledImg;
	JPanel			divider;
	JPanel			grayDrop;
	
	/**
	 * Create the application.
	 */
	public MainWindow()
	{
		getContentPane().addComponentListener(new ComponentAdapter()
		{
			@Override
			public void componentResized(ComponentEvent arg0)
			{
				scaledImg = Scalr.resize(GlobalVariables.banner, Scalr.Method.SPEED, Scalr.Mode.FIT_TO_WIDTH, arg0.getComponent().getWidth(), 400, Scalr.OP_ANTIALIAS);
				springLayout.putConstraint(SpringLayout.SOUTH, banner, scaledImg.getHeight(), SpringLayout.NORTH, getContentPane());
				banner.setIcon(new ImageIcon(scaledImg));
				
				springLayout.putConstraint(SpringLayout.NORTH, divider, getContentPane().getWidth() /4, SpringLayout.NORTH, getContentPane());
				springLayout.putConstraint(SpringLayout.SOUTH, divider, (getContentPane().getWidth() /4) + 15, SpringLayout.NORTH, getContentPane());
				
				springLayout.putConstraint(SpringLayout.NORTH, grayDrop, -50, SpringLayout.NORTH, getContentPane());
				springLayout.putConstraint(SpringLayout.WEST, grayDrop, getContentPane().getWidth() / 12, SpringLayout.WEST, getContentPane());
				springLayout.putConstraint(SpringLayout.SOUTH, grayDrop, (getContentPane().getWidth() /9), SpringLayout.NORTH, getContentPane());
				springLayout.putConstraint(SpringLayout.EAST, grayDrop, (getContentPane().getWidth() / 12) * 6, SpringLayout.WEST, getContentPane());
				
				getContentPane().repaint();
			}
		});
		initialize();
	}
	
	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize()
	{
		// window properties
		setBounds(100, 100, 1500, 699);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		// layout
		springLayout = new SpringLayout();
		getContentPane().setLayout(springLayout);
		
		
		
		// banner stuff
		banner = new JLabel("");
		scaledImg = Scalr.resize(GlobalVariables.banner, Scalr.Method.ULTRA_QUALITY, Scalr.Mode.FIT_TO_WIDTH, this.getWidth(), 400, Scalr.OP_ANTIALIAS);
		springLayout.putConstraint(SpringLayout.NORTH, banner, 0, SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.WEST, banner, 0, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, banner, scaledImg.getHeight(), SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, banner, 0, SpringLayout.EAST, getContentPane());
		banner.setIcon(new ImageIcon(scaledImg));
		getContentPane().add(banner);
		
		
		
		//divider stuff
		divider = new JPanel();
		divider.setBackground(Color.decode("#dd3322"));
		springLayout.putConstraint(SpringLayout.NORTH, divider, getContentPane().getWidth() , SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.WEST, divider, 0, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, divider, (getContentPane().getWidth() ) + 30, SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, divider, 0, SpringLayout.EAST, getContentPane());
		getContentPane().add(divider);
		
		
		
		//logo & name stuff
		grayDrop = new JPanel();
		//grayDrop.setBackground(Color.decode("#505050"));
		grayDrop.setOpaque(false);
		grayDrop.setBorder(new RoundEdgedBorder());
		springLayout.putConstraint(SpringLayout.NORTH, grayDrop, -50, SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.WEST, grayDrop, getContentPane().getWidth() / 12, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, grayDrop, (getContentPane().getWidth() /9), SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, grayDrop, (getContentPane().getWidth() / 12) * 6, SpringLayout.WEST, getContentPane());
		getContentPane().add(grayDrop);
		
		
		
		// tie up loose ends
		getContentPane().setComponentZOrder(banner, 2);
		getContentPane().setComponentZOrder(divider, 1);
		getContentPane().setComponentZOrder(grayDrop, 0);
		setVisible(true);
	}
}

@@ -683,16 +683,76 @@
 ow()%0A%09%7B%0A
+%09%09%0A%09%09//Code for resizing shit. We'll do that later.%0A%09%09%0A%09%09/*%0A
 %09%09getCon
@@ -2040,16 +2040,21 @@
 %7D%0A%09%09%7D);%0A
+%09%09*/%0A
 %09%09initia
@@ -2061,16 +2061,46 @@
 lize();%0A
+%09%09getContentPane().repaint();%0A
 %09%7D%0A%09%0A%09/*
@@ -2227,17 +2227,70 @@
 00, 
-15
+9
 00, 
-699
+950);%0A%09%09setResizable(false);%0A%09%09setLocationRelativeTo(null
 );%0A%09
@@ -2337,24 +2337,27 @@
 _CLOSE);%0A%09%09%0A
+%09%09%0A
 %09%09// layout%0A
@@ -3315,16 +3315,18 @@
 Width() 
+/4
 , Spring
@@ -3400,20 +3400,21 @@
 gLayout.
-WEST
+SOUTH
 , divide
@@ -3408,33 +3408,69 @@
 SOUTH, divider, 
-0
+(getContentPane().getWidth() /4) + 15
 , SpringLayout.W
@@ -3460,36 +3460,37 @@
 5, SpringLayout.
-WEST
+NORTH
 , getContentPane
@@ -3528,37 +3528,36 @@
 nt(SpringLayout.
-SOUTH
+WEST
 , divider, (getC
@@ -3555,42 +3555,8 @@
 er, 
-(getContentPane().getWidth() ) + 3
 0, S
@@ -3559,37 +3559,36 @@
 0, SpringLayout.
-NORTH
+WEST
 , getContentPane
@@ -4625,24 +4625,27 @@
 ayDrop, 0);%0A
+%09%09%0A
 %09%09setVisible

Set window to a constant size. We'll deal with dynamic resizing later.