Home » Java » Trying to create a dynamic grid of JPanels – Java

Trying to create a dynamic grid of JPanels – Java

Posted by: admin October 26, 2017 Leave a comment

Questions:

Good evening once more!
I’ve been trying some days now to create a method/class that will automatically generate a grid of X*Y JPanels inside a Netbeans GUI-Builder interface.. The thing is, I’ve tried every single YouTube video or post to achieve it, but none of them seem to work.
I have created a class extending the JPanel class, but the panel (with colored background) won’t appear inside the gui, although I’ve put all the necessary alignments.. Is there anyone who can help with this one..? Thanks in advance!

EDIT:: I’ve cleared the code of the classes created for this, as they did not work.. I have 2 textboxes and a button with which I want to generate a “dynamic” table of JPanels.. One textbox for the Width and one for the height of the table. I’ll rewrite the previous code and post it when I have access to my laptop!

Answers: