Why doesn't the second JTextField show up when I press the button? If I have the JTextField setVisible to true in the constructor, and set it to false in the actionPerformed method, it works, but if it starts out setVisible(false) it doesn't show up when the button is pressed. I'm sure it's something really stupid, but I can't seem to find what it is... Thanks so much for any help!
whenever a container's layout needs to be reset, the invalidate() method should be called on the conatiner object. a conatiner'r layout needs to be reset when: 1) it iself needs to be resized 2) when one or more of its components' size need to be resized 3) when a new component is going to be added this method should be called on the components' objects (if they are involved), the conatiner and the parent container and so on upto the topmost container. a change in layout in a child container affects the layout upto the top containment heirarchy!! so calling invalidate() on those components or containers concerned marks them invalidate and says they need to be laid out.