Hello, I have recently been making a program in which I've been doing it DIY. I've been using a system where I have constructors that return my main JPANEL from my original class in which the Main Method calls.

I've basically created the whole UI now, however I am now trying to add a bit of functionality to it. I have made a feature that when I click "Save Changes" and it saves to an external class in which I can retrieve data for alter usage. However, whenever I load up the JPanel it loads up the old data, however, if I click on another JPanel and then go back to it again it works =S.

Java Code:
	/*-----------------------------------------------------------------------
	 ------------------CHANGE PANEL LISTENER SETTINGS---------------------------
	 ------------------------------------------------------------------------
	*/
	
	public void panelSettingsActionPerformed(ActionEvent e){
		try{
			frame.contentPane.remove(frame.mainPane);
			frame.contentPane.remove(frame.lowerPane);
		}
		catch(Exception i){	
		System.out.println("No Such Frame Exists");
		}
		frame.mainPane = settingsMainContent.getContent();
		frame.lowerPane = new JScrollPane();
		frame.contentPane.add(settingsMainContent.getContent(), frame.contentLayout.CENTER);
		frame.contentPane.add(frame.lowerPane, frame.contentLayout.SOUTH);
		settingsMainContent = new HomeSystemSettingsHomeContent(this);
		frame.revalidate();
	}

	class panelSettingsActionAdapter implements ActionListener
	{
		HomeSystemLeftMenuContent adaptee;
		panelSettingsActionAdapter(HomeSystemLeftMenuContent adaptee)
	{		
			this.adaptee = adaptee;	
	}	
	
		public void actionPerformed(ActionEvent e)	
	{		
			adaptee.panelSettingsActionPerformed(e);
	}
	}
	
	/*-----------------------------------------------------------------------
	 ------------------------------------END---------------------------------
	 ------------------------------------------------------------------------
	*/
That is one of my Action Listeners to switch UI panels. I simply can't wrap my head around it. It's really annoying because you have to click another button to go to another JPANEL, then you go back to the JPANEL that you saved and it returns the normal data, then when you go back again to the other JPanel and then back to the saved one it works.

Just don't know =(