This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
Call validate() method on JFrame after adding the new Button
Posted by Kishori Sharan on March 26, 2001 at 4:59 PM
If your class looks like public class MyFrame extends JFrame { } and you have put the code you have mentioned in your query in some constructor or method of the frame then add the following line in actionPerformed() method. MyFrame.this.validate ( ) ; YOu just have to call validate () method on the frame in which you are adding the JButton after the JButton is added. Thanx Kishori
Replies:
|