Rather than adding a new panel to the frame every time you press the button why not just reuse the existing panel.

For example change the 3 parameter constructor in NyPanel to a method ie setValues(..) and then just call this method from the action listener.

The problem with dynamically changing the components on a displayed screen is you have to force the container and layout manager to re-validate themselves. Sometimes this is the approach you have to take but in your case there is no reason I can see why you can't reuse the NyPanel you have already added.