public void propertyChange(PropertyChangeEvent e) {
	        String prop = e.getPropertyName();

	   
	        if (isVisible()  && (e.getSource() == optionPane)
	        			&& (JOptionPane.VALUE_PROPERTY.equals(prop) ||
	        					JOptionPane.INPUT_VALUE_PROPERTY.equals(prop))) {
	            System.out.println("Property change!");
	            Object value = optionPane.getValue();

	            System.out.println(value);
	            if (value == JOptionPane.UNINITIALIZED_VALUE) {
	                //ignore reset
	                System.out.println("Property change. Reset.");
	                return;
	            }
	            if(value.equals("Enter")){

	            	System.out.println("saving db info");
	            	db.setPort(dbLocation.getText());
	            	db.setUser(dbUser.getText());
	            	db.setPass(new String(dbPass.getPassword()));
	            	
		            //save db info if save is checked
	            	
		            if(save.isSelected()){
		            	try {
		            		System.out.println("printing db info to connect.xml");
							db.connectXML();
						} catch (ParserConfigurationException e1) {
							// TODO Auto-generated catch block
							e1.printStackTrace();
						}
		            	
		            }
		            clearAndHide();
		            	//parent.setDbData(db);
	            }
	            else if(value.equals("Cancel")){ //user closed dialog or clicked cancel	  
		              //  System.out.println("Property change. canceled");
		                clearAndHide();
		            }
	            //Reset the JOptionPane's value.
	            //If you don't do this, then if the user
	            //presses the same button next time, no
	            //property change event will be fired.
	            else{
	            optionPane.setValue(JOptionPane.UNINITIALIZED_VALUE);
	            clearAndHide();
	            }
	        }
	        
	    }