|
-
June 28th, 2010, 04:30 AM
#2
Re: Java, graphics..
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|