I have a JPanel
that I want to add some components. in particular JButton
s to at runtime based on the content of a user supplied file.
I can add compontents to panel if I call it from the constructor of the JFrame derived form class, even after everything else have been constructed, but If I read the file first and then add components to the panel the call succeds but the added components are never shown.
Does anybody know how I force Java to do as I want?
Call the method validate()
on the JPanel
after you have added the JButton
s to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With