• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamically updating frame has me stumped.

 
Delbert Bell
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I am new to java and am having trouble dynamically updating a frame.

Here is some sample code:



So basically, the frame starts out with two buttons. One in the north and one in the south. When I click on the one in the south I expect a new button to be added to the center of the frame, but nothing happens. However, if I uncomment the line in the actionPerformed method which changes the text of the south button then the center button also gets added (which is what I want). I am assuming it has something to do with changing the text on the south button forcing an update that doesn't otherwise occur but I can't figure out the mechanism. I would greatly appreciate any help.

Thanks!
 
Delbert Bell
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just needed to call the validate method on the frame. All is well now.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic