My program has two windows. Lets call them Window A and Window B.
When the user loads up the program Window A appears which lets the user load up a .txt file. This .txt file contains
important data for Window B to work correctly. When the .txt file is loaded, the user clicks on a button and Window B loads up and using the data from the .txt file from Window A to correctly display.
The problem comes when I want to use a different .txt file. On Window B I have a button which loads up Window A again to let the user type in different values. When the user clicks on the button to load Window B up again all my swing components don't display correctly. In Window B I use a BorderLayout, so when I reload Window B with the new values the right hand side of the BorderLayout seems to disappear. I think that what my program is doing is reloading all the component on-top of each other which is why it providing strange results and I am just wondering how I can rectify this issue.
The problem doesn't lie with the new values from the .txt files, as the values from .txt file doesn't interact with the swing components.
Here is the code I have when loading Window A from Window B to let the user type in different values.