private void createWindow (JFrame f){	
    	final JComboBox categoryList=  new JComboBox(categoryStrings);   	//initiate drop down lists 
    	final JComboBox ratingList= new JComboBox(ratings);    	
    	final JComboBox yearList= new JComboBox(years);
    	final JComboBox pageList= new JComboBox(pages);
    	
    	final JFrame frame2=new JFrame("Create New Entry");	//initiate frame and panel 
    	final JTextField [] textField=new JTextField[3];
    	
    	JPanel p=new JPanel();  
    	p.setLayout(new FlowLayout());
    	   	
    	JLabel title=new JLabel("Book Title:");		textField[0]=new JTextField(20); 	//initiate labels and appropriate text fields for certain labels
    	
    	JLabel author=new JLabel("Author:");		textField[1]=new JTextField(20);
    	JLabel year= new JLabel("Year Published:");	
    	JLabel pages= new JLabel("Page Numbers:"); 	
    	JLabel publisher=new JLabel("Publisher:"); 	textField[2]=new JTextField(20);
    	JLabel category=new JLabel("Category:"); JLabel rating=new JLabel("Book Rating:");
    	JButton OK=new JButton ("OK");	JButton Cancel=new JButton("Cancel");		//initiate buttons 
    	
    	Box box = Box.createVerticalBox();
        box.add(Box.createVerticalGlue()); 	//glue all items vertically in a nice manner 
    	box.add(title); 	box.add(textField[0]); box.add(author); 	box.add(textField[1]); 
    	box.add(year); 		box.add(yearList);		box.add(pages); 	box.add(pageList); 
    	box.add(publisher); box.add(textField[2]); box.add(category); 	box.add(categoryList); 
    	box.add(rating); 	box.add(ratingList);
    	Box box2=Box.createHorizontalBox();
    	box2.add(Box.createHorizontalGlue()); 	
    	box2.add(OK); box2.add(Cancel);
    	p.add(box); p.add(box2);		//add boxes to panel 
    	
		frame2.setResizable(false);
		frame2.add(p);
		frame2.setSize(300,350);
		frame2.setVisible(true);   	//let the frame be visible
		
		OK.addActionListener(new ActionListener() {
			boolean checkpoint=true; 
			
			public void actionPerformed(ActionEvent e) {
				String titleField=(String) textField[0].getText();	//get the information entered by user in the text fields 
				String authorField=(String) textField[1].getText();
				String publisherField=(String) textField[2].getText();
				String yearField=(String) yearList.getSelectedItem();
				String pageField=(String) pageList.getSelectedItem();
				String categoryField=(String)categoryList.getSelectedItem();
				String ratingField=(String)ratingList.getSelectedItem();
				
				if (titleField.trim().equals("") || authorField.trim().equals("") || yearField.equals("-Select One-") 
					|| pageField.equals("-Select One-") || publisherField.trim().equals("") || categoryField.equals("-Select One-") 
					||ratingField.equals("-Select One-")) {	
					
					JOptionPane.showMessageDialog(frame,	//if one or more text field contains no information or 'select one', an error 
															//will be outputted
							"Please fill in all fields. If there is unknown information, select '---' from the options.",
		                    "Error Message",
		                    JOptionPane.ERROR_MESSAGE);	
					checkpoint=false;
				}
				
				if (checkpoint==true) {	//if all fields are filled 
					
					String bookRecord="";
					bookRecord=bookRecord+titleField+"|"+authorField+"|"+yearField+"|"+pageField+"|"+publisherField+"|"+categoryField+"|"+ratingField;
					addToFile(bookRecord);	//add the record to library.txt 
					dataChanged=true;		//notify the table model of changes
					MyLibraryManager_Library model = new MyLibraryManager_Library();
					table.setModel(model);
					setUpYearColumn(table, table.getColumnModel().getColumn(3));	//make sure the drop-down lists are still there after 
			        setUpPageColumn(table, table.getColumnModel().getColumn(4));	//the table is notified of change
			        setUpCategoryColumn(table, table.getColumnModel().getColumn(6));
			        setUpRatingColumn(table, table.getColumnModel().getColumn(7));
					frame2.setVisible(false);
					
				}
				else {
					if (checkpoint==false) checkpoint=true; 		//reset boolean 							
				}
			}
		});
		
		Cancel.addActionListener(new ActionListener(){		//close window 
			public void actionPerformed(ActionEvent e){
				frame2.setVisible(false);
			}
		});
    }//CreateWindow()