wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Dynamically updating frame has me stumped. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Dynamically updating frame has me stumped. " Watch "Dynamically updating frame has me stumped. " New topic
Author

Dynamically updating frame has me stumped.

Delbert Bell
Greenhorn

Joined: Jul 20, 2005
Posts: 6
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

Joined: Jul 20, 2005
Posts: 6
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
 
subject: Dynamically updating frame has me stumped.