I am designing a GUI where an user can add a new ship to the system by just adding the name of the ship. The name of new ship will be stored in an ArrayList. Within my GUI design, I have implemented a JList which uses the ship ArrayList as data. The idea behind the implementation was when a new ship is added to the system, the JList would be updated with the name of the new ship in the JList as well. I know for sure that the ship name is being added to the ArrayList, because upon printing it as output, it displays, however, it does show on the JList.
I was maybe thinking, is there a refresh method I can make (if so how) or call which refreshes the frame, because I am assuming the problem is that it needs the frame to refresh in order for the JList to be updated?