I\'m trying to dynamically add some components to a JPanel, but unfortunatelly they don\'t appear. I only see the ones added in the constuctor.
Updated version (addi
Call validate() on the parent container, as shown in the Nested Layout Example. Those labels on the lower left are added dynamically. Note that calling pack()
might cause the size of the GUI to change, whereas calling validate()
won't. If you need to get the GUI to resize - call pack()
, else call validate()
.