I have a few fields I'm adding to a JPanel which are called in a method...
When the method is called the following is done :
Which I thought would remove all the previous components added to those JPanels, but subsequent execution of the methods shows the components still apprear in the JTable.
I've also tried re-instantiating the containers but this has no effect.
How can I effectively refresh the containers and remove any components from the containers that were previously added?
This is the code I'm using to add the components to their respective containers.
Have you been through the API documentation for the more basic Swing classes, eg JContainer, JComponent, Component, Container? You will probably find methods allowing you to remove child components, or things like removeAll().
Try Container first.
Don't get me started about those stupid light bulbs.