I'm still new at Java and having trouble at adding buttons using another JButton, the problem is that I can able to add them but right after I resize the form only. It means that the frame did not shown any JButton added to the panel unless I resize it.
Asked
Active
Viewed 37 times
-2
-
Welcome to SO! It would be great to share what you have tried so far and point out problem with your code to get early responses on the work you have done. – Sariq Shaikh Nov 16 '20 at 08:08
-
3Does this answer your question? [java - How would I dynamically add swing component to gui on click?](https://stackoverflow.com/questions/4279435/java-how-would-i-dynamically-add-swing-component-to-gui-on-click) – maloomeister Nov 16 '20 at 08:10
1 Answers
0
right after I posted it, they already recommended related topics here and it was resolved now thanks!
just need to add 'revalidate();' at the component for it to dynamically change along the actionListener.

JMVL
- 17
- 4
-
1Great to hear that your issue got resolved. In the future, please try to look for any related topics before posting. Most of the time, your question was already asked and answered. – maloomeister Nov 16 '20 at 08:36