private PRPlayer() {
		//Setting Icon and Location
		this.setIconImage(
				Toolkit.getDefaultToolkit().getImage(
						Infofield.class.getResource("/images/Icon.png")));
		this.setLocation(80, 20);		
		
		
		//Initializing Library Viewers and Librarys
		deck1 = new ArrayDeque<Card>();
		deck2 = new ArrayDeque<Card>();
        
		//Initializing CWindows
		MG = new CWindow("Player 1's Cemetery", cl);
		OG = new CWindow("Player 2's Cemetery", cl);
		MRA = new CWindow[4];
		ORA = new CWindow[4];
		for (int i = 1; i < 5; i++) {
			MRA[i - 1] = new CWindow("Player 1's Area " + i, cl);
			ORA[i - 1] = new CWindow("Player 2's Area " + i, cl);
		}
		//Creating JPopupMenus
		jpiSearch = new JMenuItem("Search");
		jpiSearch.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, 0));
		jpiSearch.addActionListener(this);
		jpiShuffle = new JMenuItem("Shuffle");
		jpiShuffle.addActionListener(this);
		jpiDraw = new JMenuItem("Draw");
		jpiDraw.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, 0));
		jpiDraw.addActionListener(this);
		jpiView = new JMenuItem("View");
		jpiView.addActionListener(this);
		jpiFlip = new JMenuItem("Flip");
		jpiFlip.addActionListener(this);
		jpiViewCard = new JMenuItem("View Full Image");
		jpiViewCard.addActionListener(this);
		jpiToLibrary = new JMenuItem("To Library");
		jpiToLibrary.setToolTipText("Move this card to library's top.");
		jpiToLibrary.addActionListener(this);
		jpiToBottom = new JMenuItem("To Bottom of Library");
		jpiToBottom.setToolTipText("Send the top card of this deck to its bottom.");
		jpiToBottom.addActionListener(this);
		jpiRemove = new JMenuItem("Remove Placeholder");
		jpiRemove.addActionListener(this);
		s1 = new JPopupMenu("Library");
		s1.add(jpiSearch);
		s1.add(jpiShuffle);
		s1.add(jpiDraw);
		s1.add(jpiToBottom);
		s2 = new JPopupMenu();
		s2.add(jpiView);
		s3 = new JPopupMenu();
		s3.add(jpiFlip);
		s3.add(jpiViewCard);
		s3.add(jpiToLibrary);
		s3.add(jpiRemove);
		
		//Creating Images & Card templates
		try {
			imLibrary = new ImageIcon(ImageIO.read(getClass().getResourceAsStream("/images/Library.jpg")));
			imGrave = new ImageIcon(ImageIO.read(getClass().getResourceAsStream("/images/Grave.jpg")));
			imNoCard = new ImageIcon(ImageIO.read(getClass().getResourceAsStream("/images/NCRD.jpg")));
		} catch (Exception e) {
			e.printStackTrace();
			imLibrary = null;
			imGrave = null;
			imNoCard = null;
		}
		bkCard = new Card("FDCard", "/images/Back.jpg");

		//Creating the Hands
		h1 = new Collec("Player 1's Collection", cl);
		h2 = new Collec("Player 2's Collection", cl);
		h1.setLocation(600, 50);
		h2.setLocation(600, 300);
		
		//Creating Menus and main JFrame
		this.setTitle("PRPlayer");
		this.setSize(new Dimension(900, 700));
		jmAct = new JMenu("View");
		jmGame = new JMenu("Actions");
		jmHelp = new JMenu("Help");
		jmLibrary = new JMenu("Library");
		jmiExit = new JMenuItem("Exit");
		jmiExit.addActionListener(this);
		jmiExit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, 0));
		jmiEndTurn = new JMenuItem("End Current Turn");
		jmiEndTurn.addActionListener(this);
		jmiEndTurn.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, 0));
		jmiShowMH = new JMenuItem("Show Player 1's Collection");
		jmiShowMH.addActionListener(this);
		jmiShowMH.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, 0));
		jmiShowOH = new JMenuItem("Show Player 2's Collection");
		jmiShowOH.addActionListener(this);
		jmiShowOH.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, ActionEvent.SHIFT_MASK));
		jmiShowR = new JMenuItem[4];
		jmiShowR[0] = new JMenuItem("Show Reserved Area 1");
		jmiShowR[0].addActionListener(this);
		jmiShowR[1] = new JMenuItem("Show Reserved Area 2");
		jmiShowR[1].addActionListener(this);
		jmiShowR[2] = new JMenuItem("Show Reserved Area 3");
		jmiShowR[2].addActionListener(this);
		jmiShowR[3] = new JMenuItem("Show Reserved Area 4");
		jmiShowR[3].addActionListener(this);
		jmiViewLibrary = new JMenuItem("View Current Player's Library");
		jmiViewLibrary.addActionListener(this);
		jmiShowTPL = new JMenuItem("Turn Player");
		jmiShowTPL.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, ActionEvent.SHIFT_MASK));
		jmiShowTPL.addActionListener(this);
		jmiPref = new JMenuItem("Preferences...");
		jmiPref.addActionListener(this);
		jmiAbout = new JMenuItem("About");
		jmiAbout.addActionListener(this);
		jmiSave = new JMenuItem("Save Game");
		jmiSave.addActionListener(this);
		jmiOpen = new JMenuItem("Open Game");
		jmiOpen.addActionListener(this);
		jmiViewRecentCard = new JMenuItem("View Recently Viewed Card");
		jmiViewRecentCard.addActionListener(this);
		jmHelp.add(jmiAbout);
		jmGame.add(jmiEndTurn);
		jmGame.add(jmiShowTPL);
		jmGame.add(jmiPref);
		jmGame.add(jmiExit);
		jmAct.add(jmiShowMH);
		jmAct.add(jmiShowOH);
		jmAct.add(jmiViewLibrary);
		jmAct.add(jmiViewRecentCard);
		jmLibrary.add(jpiSearch);
		jmLibrary.add(jpiShuffle);
		jmLibrary.add(jpiDraw);
		jmLibrary.add(jpiToBottom);
		for (int i = 0; i < jmiShowR.length; i++) {
			jmAct.add(jmiShowR[i]);
		}
		jmb.add(jmGame);
		jmb.add(jmAct);
		jmb.add(jmLibrary);
		jmb.add(jmHelp);
		this.setJMenuBar(jmb);

		//Creating the JLabels and JPanels
		jplMB = new JPanel();
		jplOB = new JPanel();
		jlbMD = new CLabel(imLibrary);
		jlbOD = new CLabel(imLibrary);
		for (int i = 0; i < 10; i++) {
		jlbMS[i+1] = new CLabel(imNoCard);
		jlbOS[i+1] = new CLabel(imNoCard);
		}

		jlbMG = new CLabel(imGrave);
		jlbOG = new CLabel(imGrave);

		//Adding MouseListeners
		jlbMD.addMouseListener(cl);
		jlbOD.addMouseListener(cl);
		jlbMG.addMouseListener(cl);
		jlbOG.addMouseListener(cl);
		for (int i = 0; i < 10; i++) {
		jlbMS[i+1].addMouseListener(cl);
		jlbOS[i+1].addMouseListener(cl);
		jlbMS[i+1].addMouseWheelListener(cl);
		jlbOS[i+1].addMouseWheelListener(cl);
		}
		jlbMD.addMouseWheelListener(cl);
		jlbOD.addMouseWheelListener(cl);
		jlbMG.addMouseWheelListener(cl);
		jlbOG.addMouseWheelListener(cl);

		//Setting Tooltip texts from jlbMD, jlbOD, jlbMG and jlbOG
		jlbMD.setToolTipText("Player 1's Library");
		jlbOD.setToolTipText("Player 2's Library");
		jlbMG.setToolTipText("Player 1's Cemetery");
		jlbOG.setToolTipText("Player 2's Cemetery");
		
		//creating Energy Zone JLabels
		for(int i = 0; i <= 12; i++) {
			jlbMM[i+1] = new CLabel(imNoCard);
			jlbMM[i+1].addMouseListener(cl);
			jlbMM[i+1].addMouseWheelListener(cl);
			jlbOM[i+1] = new CLabel(imNoCard);
			jlbOM[i+1].addMouseListener(cl);
			jlbOM[i+1].addMouseWheelListener(cl);
			jlbMB[i+1] = new CLabel(imNoCard);
			jlbMB[i+1].addMouseListener(cl);
			jlbMB[i+1].addMouseWheelListener(cl);
			jlbOB[i+1] = new CLabel(imNoCard);
			jlbOB[i+1].addMouseListener(cl);
			jlbOB[i+1].addMouseWheelListener(cl);
		}
		
		//Setting up Group Layout
		//GroupLayout 1
		gl = new GroupLayout(jplMB);
		jplMB.setLayout(gl);
		gl.setAutoCreateGaps(true);
		gl.setAutoCreateContainerGaps(true);
		GroupLayout.SequentialGroup mhGroup = gl.createSequentialGroup();
		GroupLayout.SequentialGroup mvGroup = gl.createSequentialGroup();
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[12]).addComponent(jlbMS[1]).addComponent(jlbMM[12]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[11]).addComponent(jlbMS[2]).addComponent(jlbMM[11]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[10]).addComponent(jlbMS[3]).addComponent(jlbMM[10]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[9]).addComponent(jlbMS[4]).addComponent(jlbMM[9]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[8]).addComponent(jlbMS[5]).addComponent(jlbMM[8]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[7]).addComponent(jlbMS[6]).addComponent(jlbMM[7]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[6]).addComponent(jlbMS[7]).addComponent(jlbMM[6]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[5]).addComponent(jlbMS[8]).addComponent(jlbMM[5]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[4]).addComponent(jlbMS[9]).addComponent(jlbMM[4]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[3]).addComponent(jlbMS[10]).addComponent(jlbMM[3]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[2]).addComponent(jlbMD).addComponent(jlbMM[2]));
		mhGroup.addGroup(gl.createParallelGroup().addComponent(jlbMB[1]).addComponent(jlbMG).addComponent(jlbMM[1]));
		gl.setHorizontalGroup(mhGroup);
		mvGroup.addGroup(gl.createParallelGroup()
				.addComponent(jlbMB[12])
				.addComponent(jlbMB[11])
				.addComponent(jlbMB[10])
				.addComponent(jlbMB[9])
				.addComponent(jlbMB[8])
				.addComponent(jlbMB[7])
				.addComponent(jlbMB[6])
				.addComponent(jlbMB[5])
				.addComponent(jlbMB[4])
				.addComponent(jlbMB[3])
				.addComponent(jlbMB[2])
				.addComponent(jlbMB[1])
				);
		mvGroup.addGroup(gl.createParallelGroup()
				.addComponent(jlbMS[1])
				.addComponent(jlbMS[2])
				.addComponent(jlbMS[3])
				.addComponent(jlbMS[4])
				.addComponent(jlbMS[5])
				.addComponent(jlbMS[6])
				.addComponent(jlbMS[7])
				.addComponent(jlbMS[8])
				.addComponent(jlbMS[9])
				.addComponent(jlbMS[10])
				.addComponent(jlbMD)
				.addComponent(jlbMG)
				);
		mvGroup.addGroup(gl.createParallelGroup()
				.addComponent(jlbMM[12])
				.addComponent(jlbMM[11])
				.addComponent(jlbMM[10])
				.addComponent(jlbMM[9])
				.addComponent(jlbMM[8])
				.addComponent(jlbMM[7])
				.addComponent(jlbMM[6])
				.addComponent(jlbMM[5])
				.addComponent(jlbMM[4])
				.addComponent(jlbMM[3])
				.addComponent(jlbMM[2])
				.addComponent(jlbMM[1])
				);

		gl.setVerticalGroup(mvGroup);
		
		
		//GroupLayout 2
		gl2 = new GroupLayout(jplOB);
		jplOB.setLayout(gl2);
		gl2.setAutoCreateGaps(true);
		gl2.setAutoCreateContainerGaps(true);
		GroupLayout.SequentialGroup ohGroup = gl2.createSequentialGroup();
		GroupLayout.SequentialGroup ovGroup = gl2.createSequentialGroup();
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[1]).addComponent(jlbOG).addComponent(jlbOM[1]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[2]).addComponent(jlbOD).addComponent(jlbOM[2]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[3]).addComponent(jlbOS[1]).addComponent(jlbOM[3]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[4]).addComponent(jlbOS[2]).addComponent(jlbOM[4]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[5]).addComponent(jlbOS[3]).addComponent(jlbOM[5]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[6]).addComponent(jlbOS[4]).addComponent(jlbOM[6]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[7]).addComponent(jlbOS[5]).addComponent(jlbOM[7]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[8]).addComponent(jlbOS[6]).addComponent(jlbOM[8]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[9]).addComponent(jlbOS[7]).addComponent(jlbOM[9]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[10]).addComponent(jlbOS[8]).addComponent(jlbOM[10]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[11]).addComponent(jlbOS[9]).addComponent(jlbOM[11]));
		ohGroup.addGroup(gl2.createParallelGroup().addComponent(jlbOB[12]).addComponent(jlbOS[10]).addComponent(jlbOM[12]));
		gl2.setHorizontalGroup(ohGroup);
		ovGroup.addGroup(gl2.createParallelGroup()
				.addComponent(jlbOM[1])
				.addComponent(jlbOM[2])
				.addComponent(jlbOM[3])
				.addComponent(jlbOM[4])
				.addComponent(jlbOM[5])
				.addComponent(jlbOM[6])
				.addComponent(jlbOM[7])
				.addComponent(jlbOM[8])
				.addComponent(jlbOM[9])
				.addComponent(jlbOM[10])
				.addComponent(jlbOM[11])
				.addComponent(jlbOM[12])
				);
		ovGroup.addGroup(gl2.createParallelGroup()
				.addComponent(jlbOG)
				.addComponent(jlbOD)
				.addComponent(jlbOS[1])
				.addComponent(jlbOS[2])
				.addComponent(jlbOS[3])
				.addComponent(jlbOS[4])
				.addComponent(jlbOS[5])
				.addComponent(jlbOS[6])
				.addComponent(jlbOS[7])
				.addComponent(jlbOS[8])
				.addComponent(jlbOS[9])
				.addComponent(jlbOS[10]));
		ovGroup.addGroup(gl2.createParallelGroup()
				.addComponent(jlbOB[1])
				.addComponent(jlbOB[2])
				.addComponent(jlbOB[3])
				.addComponent(jlbOB[4])
				.addComponent(jlbOB[5])
				.addComponent(jlbOB[6])
				.addComponent(jlbOB[7])
				.addComponent(jlbOB[8])
				.addComponent(jlbOB[9])
				.addComponent(jlbOB[10])
				.addComponent(jlbOB[11])
				.addComponent(jlbOB[12])
				);
		gl2.setVerticalGroup(ovGroup);
		
		//Laying out
/*		jplMB.setLayout(new GridBagLayout());
		jplOB.setLayout(new GridBagLayout());
		GridBagConstraints gbc = new GridBagConstraints();*/
		
		
		//Adding the JPanels
		JScrollPane scrMe, scrOp;
		scrMe = new JScrollPane(jplMB, 
				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		scrOp = new JScrollPane(jplOB, 
				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		
		bc.setLayout(new BorderLayout());
		bc.add(scrOp, BorderLayout.NORTH);
		bc.add(scrMe, BorderLayout.SOUTH);
		
		//Finalizing
		this.setVisible(true);
		
		//Setting configuration path
		userhome = System.getProperty("user.home");
		File confdir = new File(userhome + "/.PRPlayer/"),
				deckdir = new File(confdir.getAbsolutePath() + "/decks/");
		if (!confdir.exists()) {
			confdir.mkdir();
		}
		if (!deckdir.exists()) {
			deckdir.mkdir();
		}
		
		//Initializing Preferences JInternalFrame
		  pif = new PrefIFrame(this);
		
		//Initializing Librarys
		  pif.btnCancel.setEnabled(false);
		  pif.setVisible(true);
		 
	}